Skip to content

Commit

Permalink
Updated workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
tbetcke committed Dec 29, 2024
1 parent 89d7b3c commit 8c7a9fe
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 83 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: 📖
on:
push:
pull_request:
branches:
- main
branches: [main]
merge_group:

jobs:
Expand All @@ -20,10 +19,10 @@ jobs:
uses: mpi4py/setup-mpi@v1
with:
mpi: "mpich"
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Build docs
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples --features "mpi,strict"
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples --features "strict"

build-and-deploy-docs:
name: Build and deploy docs
Expand All @@ -44,15 +43,14 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "nightly"
components: rustfmt
- name: Set up MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: "mpich"
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Build docs
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples --features "mpi"
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples

- name: Set file permissions
run: |
Expand Down
42 changes: 10 additions & 32 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
rust-version: ["stable"]
mpi: ['openmpi']
feature-flags: ['--features "strict"']
feature-flags: ['--features "strict"', '--features "serde,strict"']
steps:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -38,8 +38,6 @@ jobs:
run: cargo test --release ${{ matrix.feature-flags }}
- name: Run tests
run: cargo test --examples --release ${{ matrix.feature-flags }}
- name: Test benchmarks build
run: cargo bench --no-run --features "mpi,strict"
- name: Run examples
run: |
python3 find_examples.py
Expand All @@ -51,12 +49,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.12"]
mpi: ['openmpi']
steps:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Set up MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -68,31 +71,6 @@ jobs:
run: |
uv venv .venv
uv pip install pip pytest
- name: Clone ndelement
uses: actions/checkout@v4
with:
path: ./ndelement
repository: bempp/ndelement
ref: main
- name: Install ndelement
run: |
source .venv/bin/activate
cd ndelement
maturin develop --release
- name: Clone ndgrid
uses: actions/checkout@v4
with:
path: ./ndgrid
repository: bempp/ndgrid
ref: main
- name: Install ndgrid
run: |
source .venv/bin/activate
cd ndgrid
maturin develop --release
- name: Install python package
run: |
source .venv/bin/activate
Expand All @@ -113,9 +91,9 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust-version }}
# - name: Install cargo-upgrades
# run: cargo install cargo-upgrades
# - uses: actions/checkout@v4
- name: Install cargo-upgrades
run: cargo install cargo-upgrades
- uses: actions/checkout@v4
- name: Check that dependencies are up to date
run:
cargo upgrades
47 changes: 10 additions & 37 deletions .github/workflows/run-weekly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ jobs:
strategy:
matrix:
rust-version: ["stable", "beta", "nightly"]
mpi: [ 'mpich', 'openmpi']
mpi: [ 'openmpi']
f_strict: ["", "strict,"]
f_serde: ["", "serde,"]
steps:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -30,33 +31,31 @@ jobs:
sudo apt-get install -y libopenblas-dev liblapack-dev

- name: Build rust library
run: cargo build --features "${{matrix.f_strict}}"
run: cargo build --features "${{matrix.f_strict}}${{matrix.f_serde}}"
- name: Build rust library in release mode
run: cargo build --release --features "${{matrix.f_strict}}"
run: cargo build --release --features "${{matrix.f_strict}}${{matrix.f_serde}}"

- name: Run unit tests
run: cargo test --features "${{matrix.f_strict}}"
run: cargo test --features "${{matrix.f_strict}}${{matrix.f_serde}}"
- name: Run unit tests in release mode
run: cargo test --release --features "${{matrix.f_strict}}"
run: cargo test --release --features "${{matrix.f_strict}}${{matrix.f_serde}}"
- name: Run tests
run: cargo test --examples --release --features "${{matrix.f_strict}}"
- name: Test benchmarks build
run: cargo bench --no-run --features "${{matrix.f_strict}}"
run: cargo test --examples --release --features "${{matrix.f_strict}}${{matrix.f_serde}}"
- name: Run examples
run: |
python3 find_examples.py
chmod +x examples.sh
./examples.sh
- name: Build docs
run: cargo doc --features "${{matrix.f_strict}}" --no-deps
run: cargo doc --features "${{matrix.f_strict}}${{matrix.f_serde}}" --no-deps

run-tests-python:
name: Run Python tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.12"]
steps:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -68,36 +67,11 @@ jobs:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Install uv
run: pip install uv "maturin>=1.7"
run: pip install uv "maturin>=1.7.2"
- name: Make virtual environment
run: |
uv venv .venv
uv pip install pip pytest
- name: Clone ndelement
uses: actions/checkout@v4
with:
path: ./ndelement
repository: bempp/ndelement
ref: main
- name: Install ndelement
run: |
source .venv/bin/activate
cd ndelement
maturin develop --release
- name: Clone ndgrid
uses: actions/checkout@v4
with:
path: ./ndgrid
repository: bempp/ndgrid
ref: main
- name: Install ndgrid
run: |
source .venv/bin/activate
cd ndgrid
maturin develop --release
- name: Install python package
run: |
source .venv/bin/activate
Expand All @@ -106,4 +80,3 @@ jobs:
run: |
source .venv/bin/activate
python -m pytest python/test
12 changes: 5 additions & 7 deletions .github/workflows/style-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ name: ✨

on:
push:
branches:
- "**"
branches: ["**"]
pull_request:
branches:
- main
branches: [main]
merge_group:

jobs:
Expand All @@ -15,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
feature-flags: ['--features "strict"', '']
feature-flags: ['--features "serde,strict"', '--features "strict"']
steps:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -26,12 +24,12 @@ jobs:
uses: mpi4py/setup-mpi@v1
with:
mpi: mpich
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install LAPACK, OpenBLAS
run:
sudo apt-get install -y libopenblas-dev liblapack-dev

- name: Style checks
- name: Rust style checks
run: |
cargo fmt -- --check
cargo clippy ${{ matrix.feature-flags }} -- -D warnings
Expand Down

0 comments on commit 8c7a9fe

Please sign in to comment.