Fix benchmarks #44
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-build | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
workflow_call: | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_RETRY: 10 | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: full | |
RUSTFLAGS: -D warnings | |
RUSTUP_MAX_RETRIES: 10 | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test-linux: | |
strategy: | |
matrix: | |
include: | |
- target: aarch64-unknown-linux-musl | |
arch: aarch64-musl | |
- target: x86_64-unknown-linux-musl | |
arch: x86_64-musl | |
runs-on: ubuntu-latest | |
container: messense/rust-musl-cross:${{ matrix.arch }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
targets: ${{ matrix.target }} | |
components: rust-std,rustfmt,clippy | |
- name: Lint | |
run: | | |
cargo fmt --all -- --check | |
cargo clippy || true | |
# | |
- name: Run tests | |
if: matrix.arch == 'x86_64-musl' | |
run: cargo test --verbose | |
- name: release | |
if: success() | |
run: cargo build --release --target=${{ matrix.target }} | |
- name: benchmarks | |
if: matrix.arch == 'x86_64-musl' | |
run: cargo bench | |
- name: upload benchmark output | |
if: matrix.arch == 'x86_64-musl' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bench-results | |
path: benches/halo2_bench_timing.txt | |
test-macos: | |
strategy: | |
matrix: | |
include: | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
targets: ${{ matrix.target }} | |
components: rust-std,rustfmt,clippy | |
- name: Lint | |
run: | | |
cargo fmt --all -- --check | |
cargo clippy || true | |
- name: Run tests | |
if: matrix.target == 'x86_64-apple-darwin' | |
run: cargo test --verbose | |
- name: release | |
if: success() | |
run: cargo build --release --target=${{ matrix.target }} |