-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: use reusable workflows * ci: use reusable workflow for check-lurk-compiles * fix: clippy * fix: inline lints minus wasm build
- Loading branch information
1 parent
311ec73
commit 880cc07
Showing
6 changed files
with
395 additions
and
38 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[profile.ci] | ||
# Print out output for failing tests as soon as they fail, and also at the end | ||
# of the run (for easy scrollability). | ||
failure-output = "immediate-final" | ||
# Show skipped tests in the CI output. | ||
status-level = "skip" | ||
# Do not cancel the test run on the first failure. | ||
fail-fast = false | ||
# Mark tests as slow after 5mins, kill them after 20mins | ||
slow-timeout = { period = "300s", terminate-after = 4 } | ||
# Retry failed tests once, marked flaky if test then passes | ||
retries = 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,99 @@ | ||
name: Tests | ||
on: [push, pull_request] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
name: Rust | ||
|
||
on: | ||
merge_group: | ||
push: | ||
branches: [dev, main] | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
branches: [dev, main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
runs-on: [ubuntu-latest] | ||
strategy: | ||
fail-fast: false | ||
env: | ||
RUSTFLAGS: -D warnings | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cache cargo build | ||
uses: Swatinem/rust-cache@v1 | ||
- uses: actions/checkout@v4 | ||
with: | ||
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: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
# Rustfmt, clippy, and doctests | ||
lints: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: lurk-lab/ci-workflows | ||
- uses: ./.github/actions/ci-env | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: minimal | ||
components: rustfmt, clippy | ||
target: wasm32-unknown-unknown | ||
|
||
- name: Run cargo fmt | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Check Rustfmt Code Style | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
- name: Check clippy warnings | ||
run: | | ||
if $(cargo --list|grep -q xclippy); then | ||
cargo xclippy -Dwarnings | ||
else | ||
cargo clippy -Dwarnings | ||
fi | ||
- name: Doctests | ||
run: cargo test --doc --workspace | ||
|
||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
# Check MSRV in `Cargo.toml` is valid | ||
msrv: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
command: clippy | ||
args: --all-targets -- -D warnings | ||
|
||
- name: Run tests | ||
uses: actions-rs/cargo@v1 | ||
repository: lurk-lab/ci-workflows | ||
- uses: ./.github/actions/ci-env | ||
- uses: actions/checkout@v4 | ||
- name: Install rustup | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
command: test | ||
|
||
- name: Run grumpkin_msm example | ||
run: cargo run --release --example grumpkin_msm | ||
toolchain: stable | ||
override: true | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Install cargo-msrv | ||
run: cargo install cargo-msrv | ||
- name: Check Rust MSRV | ||
run: cargo msrv verify | ||
|
||
- 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 |
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
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
Oops, something went wrong.