name: Rust
on:
push:
branches: ["main"]
paths:
- "**/*.rs"
- "Cargo.toml"
- "Cargo.lock"
- "build.rs"
- "rust-toolchain.toml"
- ".cargo/**"
- ".github/workflows/rust.yml"
pull_request:
branches: ["main"]
paths:
- "**/*.rs"
- "Cargo.toml"
- "Cargo.lock"
- "build.rs"
- "rust-toolchain.toml"
- ".cargo/**"
- ".github/workflows/rust.yml"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
permissions:
contents: write
deployments: write
concurrency:
group: publish-${{ github.ref_name }}
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Collect Workflow Telemetry
uses: runforesight/workflow-telemetry-action@v2
with:
comment_on_pr: false
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- run: make ci
- name: Publish benchmark summary to job summary
if: always()
run: |
if [ -f benchmark_summary.md ]; then
cat benchmark_summary.md >> "$GITHUB_STEP_SUMMARY"
else
echo "benchmark_summary.md not found." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload benchmark summary artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark_summary
path: |
benchmark_summary.md
benchmark_report.md
benchmark_result.txt
benchmark_full_report.md
benchmark_full_result.txt
- name: Upload criterion results artifact
uses: actions/upload-artifact@v7
with:
name: criterion_result
path: ./target/criterion