Skip to content

Always stop timers when exiting the 'Timer.time' block #576

Always stop timers when exiting the 'Timer.time' block

Always stop timers when exiting the 'Timer.time' block #576

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Aria Operations Integration SDK
on: [pull_request]
jobs:
sdk:
name: Aria Operations Integration SDK
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install SDK dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install .
- name: Lint SDK with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 vmware_aria_operations_integration_sdk --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 vmware_aria_operations_integration_sdk --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test SDK with pytest
run: |
pytest -s tests
- name: Upload SDK pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: tools/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
python-lib:
name: Aria Operations Integration SDK Python Adapter Library
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python Library dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install lib/python/
- name: Lint Python Library with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 lib/python --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 lib/python --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test Python Library with pytest
run: |
pytest -s lib/python/tests
- name: Upload Python Library pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: lib/python/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
java-lib:
name: Aria Operations Integration SDK Java Adapter Library
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: zulu
architecture: x64
- name: Setup and execute Gradle 'test' task
uses: gradle/gradle-build-action@v2
with:
arguments: -p ./lib/java/AdapterLibrary/ test
gradle-executable: ./lib/java/AdapterLibrary/gradlew