Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Lock uv dependencies for CI #40

Lock uv dependencies for CI

Lock uv dependencies for CI #40

Workflow file for this run

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-20.04, macos-latest, windows-latest ]
python-version: [ "3.9", "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 --frozen --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