RawDataRecord with unit tests #308
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing | |
on: [push, pull_request] | |
jobs: | |
dynamic_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install project dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools | |
pip install -r requirements.txt | |
- name: Install external packages used for dynamic tests | |
run: | | |
pip install .[test] | |
- name: Execute unit tests with coverage report [pytest] | |
run: | | |
pytest tests/software_tests --cov-report=term-missing --cov=uds -m "not integration and not performance" | |
- name: Execute integration tests with coverage report [pytest] | |
run: | | |
pytest tests/software_tests --cov-report=term-missing --cov=uds -m "integration" | |
# TODO: uncomment when performance tests are added | |
# - name: Execute performance tests with coverage report [pytest] | |
# run: | | |
# pytest tests/software_tests --cov-report=term-missing --cov=uds -m "performance" | |
code_coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install project dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools | |
pip install -r requirements.txt | |
- name: Install external packages used for dynamic tests | |
run: | | |
pip install .[test] | |
- name: Execute unit tests with instruction coverage [pytest] | |
run: | | |
pytest tests/software_tests --cov-report=xml --cov=uds -m "not integration and not performance" | |
- name: Upload unit tests report with instruction coverage [CodeCov] | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml | |
flags: unit-tests | |
- name: Execute unit tests with branch coverage [pytest] | |
run: | | |
pytest tests/software_tests --cov-report=xml --cov=uds -m "not integration and not performance" --cov-branch | |
- name: Upload unit tests report with branch coverage [CodeCov] | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml | |
flags: unit-tests-branch | |
- name: Execute integration tests with instruction coverage [pytest] | |
run: | | |
pytest tests/software_tests --cov-report=xml --cov=uds -m "integration" | |
- name: Upload integration tests report with instruction coverage [CodeCov] | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml | |
flags: integration-tests | |
- name: Execute integration tests with branch coverage [pytest] | |
run: | | |
pytest tests/software_tests --cov-report=xml --cov=uds -m "integration" --cov-branch | |
- name: Upload integration tests report with branch coverage [CodeCov] | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml | |
flags: integration-tests-branch | |
# TODO: add performance tests upload when added | |
static_code_analysis: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] # TODO: Add "3.12" when stable | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install project dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools | |
pip install -r requirements.txt | |
- name: Install external packages used for static tests | |
run: | | |
pip install .[static-code-analysis] | |
- name: Execute static code analysis [prospector] | |
run: | | |
prospector --profile tests/prospector_profile.yaml uds | |
dependency_checks: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install external packages used for dependency scanning | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[dependency-scan] | |
- name: Execute dependency scanning [safety] | |
run: | | |
safety check -r requirements.txt | |
- name: Execute dependency scanning [pip-audit] | |
run: | | |
pip-audit | |
sorting_imports: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install project dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools | |
pip install -r requirements.txt | |
- name: Install external packages used for sorting imports | |
run: | | |
pip install .[sorting-imports] | |
- name: Check imports are sorted [isort] | |
run: | | |
isort uds | |
isort tests | |
isort examples | |
documentation_checks: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install project dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Install external packages used for documentation checking | |
run: | | |
pip install .[docs-checks] | |
- name: Check RST documentation [doc8] | |
run: | | |
doc8 docs\source |