diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7226308 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: CI with Tests and Code Coverage + +on: + push: + branches: + - main + pull_request: + release: + types: + - published + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + timeout-minutes: 15 + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + shard: [0, 1, 2, 3] + fail-fast: false + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install -U pip setuptools wheel + SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt + pip install -r ./requirements-dev.txt + + - name: Run pytest tests in src/ directory + run: | + PYTHONPATH='src' pytest --num-shards=4 --shard-id=${{ matrix.shard }} tests/ \ No newline at end of file