Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 23 additions & 25 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
name: CodSpeed

on:
---
name: CodSpeed Benchmarks
"on":
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches:
- "main"
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

- main
workflow_dispatch: ~
jobs:
benchmarks:
name: Run benchmarks
name: Run Benchmarks
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install OpenMPI
run: sudo apt install -y openmpi-bin openmpi-doc libopenmpi-dev

- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v1
- name: Checkout Repository
uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Rust Tool
uses: taiki-e/install-action@v2
with:
channel: stable
cache-target: release
bins: cargo-codspeed

- name: Build the benchmark target(s)
run: cargo codspeed build --profile dist-release

- name: Run the benchmarks
tool: cargo-codspeed
- run: cargo codspeed build
- name: CodSpeed Action
uses: CodSpeedHQ/action@v4
with:
mode: simulation
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
token: ${{ secrets.CODSPEED_TOKEN }}
94 changes: 58 additions & 36 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---
name: Coverage

on:
"on":
pull_request:
paths:
- "**.rs"
- "**.py"
- ".github/workflows/coverage.yml"
types:
- opened
- reopened
- synchronize
push:
branches:
- main
Expand All @@ -17,60 +21,78 @@ on:
secrets:
codecov_token:
required: true
workflow_dispatch:
workflow_dispatch: ~
jobs:
coverage-rust:
permissions:
contents: read
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v6
- name: Install OpenMPI
run: sudo apt install -y clang mpich libmpich-dev
- name: Install Rust
run: rustup update nightly
- name: Install Just
uses: taiki-e/install-action@just
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate Rust code coverage
run: just coverage-rust
- name: Upload coverage report
uses: actions/upload-artifact@v5
- name: Checkout Repository
uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
- name: Install Rust Tool
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- run: cargo llvm-cov --workspace --lcov --output-path coverage-rust.lcov --summary-only --exclude-from-report py-laddu
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: coverage-rust
path: coverage-rust.lcov
name: coverage-rust
coverage-python:
permissions:
contents: read
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v6
- name: Install uv
- name: Checkout Repository
uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup uv
uses: astral-sh/setup-uv@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Just
uses: taiki-e/install-action@just
- name: Generate Python code coverage
run: just coverage-python
- name: Upload coverage report
uses: actions/upload-artifact@v5
- run: |-
uv venv
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
uvx --with "maturin[patchelf]>=1.7,<2" maturin build --manifest-path py-laddu-cpu/Cargo.toml --release -o py-laddu-cpu/dist
uv pip install --no-cache-dir --find-links py-laddu-cpu/dist laddu-cpu
uv pip install --no-cache-dir -e "py-laddu[tests]"
pytest --cov --cov-report xml:coverage-python.xml
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: coverage-python
path: coverage-python.xml
name: coverage-python
upload-coverage:
needs: [coverage-rust, coverage-python]
permissions:
contents: read
needs:
- coverage-rust
- coverage-python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download coverage reports
uses: actions/download-artifact@v6
- name: Checkout Repository
uses: actions/checkout@v6
- name: Download Artifact
uses: actions/download-artifact@v7
with:
merge-multiple: true
- name: Upload coverage reports to Codecov
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-rust.lcov,coverage-python.xml
fail_ci_if_error: true
verbose: true
files: "coverage-rust.lcov,coverage-python.xml"
root_dir: ${{ github.workspace }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
Loading
Loading