Skip to content

Commit

Permalink
Update CI to test Wasm simd128, avx2 and aarch64 neon (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmilson authored May 20, 2024
1 parent 2f84421 commit bbeb3be
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 21 deletions.
72 changes: 52 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
toolchain: nightly-2024-01-04
- uses: Swatinem/rust-cache@v2
- run: scripts/clippy.sh

doc:
runs-on: ubuntu-latest
steps:
Expand All @@ -49,17 +49,51 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2024-01-04 doc

run-wasm32-wasi-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
targets: wasm32-wasi
- uses: taiki-e/install-action@v2
with:
tool: wasmtime
- uses: Swatinem/rust-cache@v2
- run: cargo test --target wasm32-wasi
env:
CARGO_TARGET_WASM32_WASI_RUNNER: "wasmtime run --"
RUSTFLAGS: -C target-feature=+simd128

run-neon-tests:
runs-on: macos-latest-xlarge
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly-2024-01-04 test
env:
RUSTFLAGS: -C target-feature=+neon

run-avx-tests:
strategy:
matrix:
target-feature: [avx512f, avx2]
runs-on: avx
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-04
- uses: Swatinem/rust-cache@v2
- run: ./scripts/test_avx.sh

run-avx-bench:
- run: cargo +nightly-2024-01-04 test
env:
RUSTFLAGS: -C target-cpu=native -C target-feature=+${{ matrix.target-feature }}

run-avx512-bench:
runs-on: avx
steps:
- uses: actions/checkout@v4
Expand All @@ -76,20 +110,17 @@ jobs:
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'cargo'
tool: "cargo"
output-file-path: output.txt
external-data-json-path: ./cache/benchmark-data.json
fail-on-alert: true
summary-always: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
alert-comment-cc-users: '@spapinistarkware'
alert-comment-cc-users: "@spapinistarkware"

run-tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest-xlarge]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand All @@ -116,17 +147,18 @@ jobs:
env:
RUSTUP_TOOLCHAIN: nightly-2024-01-04


all-tests:
runs-on: ubuntu-latest
needs:
- clippy
- format
- run-tests
- run-avx-tests
- udeps
- clippy
- format
- run-tests
- run-avx-tests
- run-neon-tests
- run-wasm32-wasi-tests
- udeps
steps:
- name: Decide whether all the needed jobs succeeded or failed
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}
- name: Decide whether all the needed jobs succeeded or failed
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
# TODO: Merge coverage reports for tests on different architectures.
# <https://github.com/taiki-e/cargo-llvm-cov?tab=readme-ov-file#merge-coverages-generated-under-different-test-conditions>
- name: Generate code coverage
run: cargo +nightly-2024-01-04 llvm-cov --codecov --output-path codecov.json
env:
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = ["crates/prover"]
resolver = "2"

[workspace.package]
version = "0.1.1"
Expand Down
12 changes: 11 additions & 1 deletion crates/prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@ tracing.workspace = true

[dev-dependencies]
aligned = "0.4.2"
criterion = { version = "0.5.1", features = ["html_reports"] }
test-log = { version = "0.2.15", features = ["trace"] }
tracing-subscriber = "0.3.18"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies.criterion]
features = ["html_reports"]
version = "0.5.1"

# Default features cause compile error:
# "Rayon cannot be used when targeting wasi32. Try disabling default features."
[target.'cfg(target_arch = "wasm32")'.dev-dependencies.criterion]
default-features = false
features = ["html_reports"]
version = "0.5.1"

[lib]
bench = false

Expand Down

0 comments on commit bbeb3be

Please sign in to comment.