Skip to content

ci: add test matrix #12

ci: add test matrix

ci: add test matrix #12

Workflow file for this run

name: OpenFisca-Core / Pull request review
on:
pull_request:
types: [assigned, opened, reopened, synchronize, ready_for_review]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
numpy: [2.1.1, 1.24.2]
python: [3.12.6, 3.9.13] # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. If left unspecified, different patch versions could be allocated between jobs, and any such difference would lead to a cache not found error.
include:
- os: ubuntu-latest
activate_command: source venv/bin/activate
- os: windows-latest
activate_command: .\venv\Scripts\activate
uses: ./.github/workflows/_before.yaml
with:
os: ${{ matrix.os }}
numpy: ${{ matrix.numpy }}
python: ${{ matrix.python }}
activate_command: ${{ matrix.activate_command }}
test:
needs: [setup]
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
numpy: [2.1.1, 1.24.2]
python: [3.12.6, 3.9.13] # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. If left unspecified, different patch versions could be allocated between jobs, and any such difference would lead to a cache not found error.
include:
- os: ubuntu-latest
activate_command: source venv/bin/activate
- os: windows-latest
activate_command: .\venv\Scripts\activate
uses: ./.github/workflows/_test.yaml
with:
os: ${{ matrix.os }}
numpy: ${{ matrix.numpy }}
python: ${{ matrix.python }}
activate_command: ${{ matrix.activate_command }}
lint:
needs: [setup]
strategy:
fail-fast: true
matrix:
numpy: [1.24.2]
python: [3.12.6, 3.9.13] # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. If left unspecified, different patch versions could be allocated between jobs, and any such difference would lead to a cache not found error.
uses: ./.github/workflows/_lint.yaml
with:
os: ubuntu-latest
numpy: ${{ matrix.numpy }}
python: ${{ matrix.python }}
activate_command: source venv/bin/activate
# The idea behind these dependencies is we want to give feedback to
# contributors on the version number only after they have passed all tests,
# so they don't have to do it twice after changes happened to the main branch
# during the time they took to fix the tests.
check-version:
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all the tags
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.20 # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. If left unspecified, different patch versions could be allocated between jobs, and any such difference would lead to a cache not found error.
- name: Check version number has been properly updated
run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh"