Merge branch 'main' into mscroggs/generate-kernels #1180
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: 🧪 Test | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
run-tests-rust: | |
name: Run tests (Rust) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust-version: ["stable", "nightly"] | |
mpi: ['mpich', 'openmpi'] | |
steps: | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust-version }} | |
components: rustfmt | |
- name: Set up MPI | |
uses: mpi4py/setup-mpi@v1 | |
with: | |
mpi: ${{ matrix.mpi }} | |
- name: Install cargo-mpirun | |
run: cargo install cargo-mpirun | |
- uses: actions/checkout@v3 | |
- name: Install LAPACK & OpenBLAS | |
run: | |
sudo apt-get install libopenblas-dev liblapack-dev | |
- name: Style checks | |
run: | | |
cargo +${{ matrix.rust-version }} fmt -- --check | |
cargo +${{ matrix.rust-version }} clippy -- -D warnings | |
cargo +${{ matrix.rust-version }} clippy --tests -- -D warnings | |
cargo +${{ matrix.rust-version }} clippy --examples -- -D warnings | |
- name: Build rust library | |
run: cargo +${{ matrix.rust-version }} build --features "strict" | |
- name: Run unit tests | |
run: cargo +${{ matrix.rust-version }} test --lib --features "strict" | |
- name: Run unit tests (with mpi enabled) | |
run: cargo +${{ matrix.rust-version }} test --lib --features "mpi,strict" | |
- name: Run tests | |
run: cargo +${{ matrix.rust-version }} test --examples --release --features "mpi,strict" | |
- name: Run examples | |
run: | | |
python3 find_examples.py --cargo-version ${{ matrix.rust-version }} | |
chmod +x examples.sh | |
./examples.sh | |
- name: Build docs | |
run: cargo +${{ matrix.rust-version }} doc --features "strict" --no-deps | |
run-tests-python: | |
name: Run tests (Python) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v3 | |
- name: Install Python requirements | |
run: python3 -m pip install pytest-xdist flake8 | |
- name: Style checks | |
run: | | |
python3 -m flake8 python/test | |
- name: Install tomllib (for Python <3.11) | |
run: python3 -m pip install tomli | |
if: ${{ matrix.python-version == '3.7' || matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10' }} | |
- run: python3 -m pytest -n=auto python/test | |
name: Run tests |