ci: Correctly specify string for branch name type #44
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: Run Unit Tests | |
on: | |
# trigger on pull requests | |
pull_request: | |
# trigger on all commits to main | |
push: | |
branches: | |
- 'main' | |
# trigger on request | |
workflow_dispatch: | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: test (${{ matrix.os }}, ${{ matrix.python }}, ${{ matrix.dependencies }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest] | |
python: ['3.9', '3.10', '3.11', '3.12'] | |
include: | |
# Defaults to newest dependencies | |
- dependencies: 'newest' | |
# Other tests | |
- python: '3.9' | |
dependencies: 'oldest' | |
- os: 'macos-latest' | |
python: '3.9' | |
dependencies: 'oldest' | |
- os: 'macos-latest' | |
python: '3.12' | |
dependencies: 'newest' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Update pip/build packages | |
run: | | |
pip install setuptools --upgrade | |
- name: Install newest dependencies | |
run: | | |
pip install -r requirements/requirements-test.txt | |
pip install -r requirements/requirements-data.txt | |
if: ${{ matrix.dependencies == 'newest' }} | |
- name: Install oldest dependencies | |
run: | | |
pip install -r .github/workflows/ci-oldest-reqs.txt | |
pip install -r requirements/requirements-data.txt | |
if: ${{ matrix.dependencies == 'oldest' }} | |
- name: Install numba (if available) | |
run: | | |
pip install -r requirements/requirements-jit.txt | |
if: ${{ matrix.python != '3.12' }} | |
- name: Install the package | |
run: | | |
pip install -e . | |
- name: Test with pytest | |
run: | | |
pytest --cov=dupin --cov-config=pyproject.toml --cov-report=xml tests -v | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |