Skip to content

Unit testing/add new unit tests to enhance test coverage and reliability #2331

Unit testing/add new unit tests to enhance test coverage and reliability

Unit testing/add new unit tests to enhance test coverage and reliability #2331

name: build
on:
push:
branches:
- "main"
pull_request:
branches:
- "release/*"
- "patch/*"
- "main"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9","3.10" ]
steps:
- name: Free up disk space at start
run: |
sudo apt clean
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
df -h
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1
with:
version: 1.3.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --with dev --all-extras
- name: Check linting
run: |
poetry run task lint
- name: Check formatting
run: |
poetry run task is-formatted
- name: Test with pytest
run: |
poetry run task force-cpu-torch
poetry run task extra-lib
poetry run task test