Update Ubuntu to 22.04; remove Python 3.9 #43
This file contains hidden or 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: CI | |
| on: | |
| pull_request: | |
| push: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # Many color libraries just need this to be set to any value, but at least | |
| # one distinguishes color depth, where "3" -> "256-bit color". | |
| FORCE_COLOR: 3 | |
| jobs: | |
| checks: | |
| name: Check Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-22.04, macos-latest, windows-latest ] | |
| python-version: [ "3.10", "3.11", "3.12" ] | |
| fail-fast: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v1 | |
| - name: Install Python ${{ matrix.python-version }} | |
| run: uv python install ${UV_PYTHON} | |
| # Use msmpi on windows | |
| - uses: mpi4py/setup-mpi@v1 | |
| if: ${{ contains(matrix.os, 'windows') }} | |
| with: | |
| mpi: msmpi | |
| # Else, use the default for the OS and setup-mpi action | |
| - uses: mpi4py/setup-mpi@v1 | |
| if: ${{ !contains(matrix.os, 'windows') }} | |
| # Setup openmp on macOS | |
| - name: Install openmp if on macos | |
| if: ${{ contains(matrix.os, 'macos') }} | |
| run: | | |
| brew install libomp llvm | |
| - name: Synchronize project environment | |
| run: uv sync --locked --extra dev --extra matnormal --extra examples | |
| - name: Run static analysis and tests | |
| if: runner.os == 'Linux' | |
| run: | | |
| uv run ./run-checks.sh | |
| uv run ./run-tests.sh | |
| uv run bash -lc 'cd docs && make' | |
| - name: Run static analysis and tests | |
| if: runner.os == 'macOS' | |
| run: | | |
| export CLANG_PREFIX=$(brew --prefix llvm) | |
| export CC=$CLANG_PREFIX/bin/clang | |
| export CXX=$CLANG_PREFIX/bin/clang++ | |
| uv run ./run-checks.sh | |
| uv run ./run-tests.sh | |
| uv run bash -lc 'cd docs && make' | |
| # On window, just install the package and run tests for now, we need to port the pr-check script to windows | |
| - name: Run tests and other checks | |
| if: runner.os == 'Windows' | |
| run: | | |
| uv run python -m pytest -v | |
| # - uses: codecov/codecov-action@v1 |