From 1c83851741e3cd723eff9d0b1c6395b8be429b51 Mon Sep 17 00:00:00 2001 From: Casper Welzel Andersen Date: Wed, 22 Nov 2023 09:52:19 +0100 Subject: [PATCH] Add pytest CI job --- .github/workflows/ci_tests.yml | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index de7ce86..6fc2396 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -105,3 +105,39 @@ jobs: exit 1 } + + pytest: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python_version: ["3.10", "3.11", "3.12"] + + steps: + - name: Checkout ${{ github.repository }} + uses: actions/checkout@v4 + + - name: Setup Python ${{ matrix.python_version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + + - name: Install test dependencies + run: | + python -m pip install -U pip + pip install -U setuptools wheel flit + pip install -U -e .[testing] + + - name: Run pytest + run: pytest -vv --cov-report=xml + + - name: Upload coverage + if: github.repository_owner == 'SINTEF' && matrix.python_version == '3.10' + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + env_vars: OS,PYTHON + env: + OS: ubuntu-latest + PYTHON: ${{ matrix.python_version }}