Skip to content

Commit

Permalink
ci: use reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Jan 8, 2024
1 parent 0965aeb commit a9cc790
Show file tree
Hide file tree
Showing 3 changed files with 344 additions and 43 deletions.
110 changes: 70 additions & 40 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,78 @@
name: Tests
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
name: Rust

- name: Cache cargo build
uses: Swatinem/rust-cache@v1
on:
merge_group:
push:
branches: [dev, main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [dev, main]

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt, clippy
target: wasm32-unknown-unknown

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

- name: Run cargo clippy
uses: actions-rs/cargo@v1
jobs:
test:
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
with:
command: clippy
args: --all-targets -- -D warnings
repository: lurk-lab/ci-workflows
- uses: ./.github/actions/ci-env
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
# make sure benches don't bit-rot
- name: build benches & examples
run: cargo build --benches --examples --release
- name: cargo test
run: |
cargo nextest run --release --profile ci
- name: Doctests
run: |
cargo test --doc
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
check-lurk-compiles:
if: github.event_name == 'pull_request'
runs-on: [ubuntu-latest]
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/bellpepper
- uses: actions/checkout@v4
with:
repository: lurk-lab/lurk-rs
path: ${{ github.workspace }}/lurk
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Patch Cargo.toml
working-directory: ${{ github.workspace }}/lurk
run: |
echo "[patch.'https://github.com/lurk-lab/grumpkin-msm']" >> Cargo.toml
echo "grumpkin-msm = { path='../grumpkin-msm' }" >> Cargo.toml
- name: Check Lurk-rs types don't break spectacularly
working-directory: ${{ github.workspace }}/lurk
run: cargo check --all --tests --benches --examples

- name: Run grumpkin_msm example
run: cargo run --release --example grumpkin_msm
# Wasm build, rustfmt, clippy, doctests, and MSRV
code-quality:
uses: lurk-lab/ci-workflows/.github/workflows/lints.yml@main

- name: Run pasta_msm example
run: cargo run --release --example pasta_msm
# Check documentation links aren't broken
link-checker:
uses: lurk-lab/ci-workflows/.github/workflows/links-check.yml@main
with:
fail-fast: true

- name: Check benches build
run: cargo check --benches
# Lint dependencies for licensing and auditing issues as per https://github.com/lurk-lab/bellpepper/blob/main/deny.toml
licenses-audits:
uses: lurk-lab/ci-workflows/.github/workflows/licenses-audits.yml@main
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ portable = [ "blst/portable", "semolina/portable" ]
# Binary can be executed on Broadwell+ and Ryzen+ systems.
force-adx = [ "blst/force-adx", "semolina/force-adx" ]
cuda-mobile = []
# Build with __MSM_SORT_DONT_IMPLEMENT__ to prevent redefining
# symbols that breaks compilation during linking.
dont-implement-sort = []

[dependencies]
blst = "~0.3.11"
Expand Down
Loading

0 comments on commit a9cc790

Please sign in to comment.