Skip to content

fix: 1.79.0 lints (#40) #105

fix: 1.79.0 lints (#40)

fix: 1.79.0 lints (#40) #105

Workflow file for this run

on:
pull_request:
push:
branches:
- main
name: build
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --all-features -- --nocapture
test_wasm:
name: Test WebAssembly (WASI)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-wasi
- uses: taiki-e/install-action@d0c2bb4cffa2484ea6862a142a14b7ac5057c74a
with:
tool: wasmtime,cargo-wasi
- env:
CARGO_TARGET_WASM32_WASI_RUNNER: "wasmtime --dir=."
run: cargo wasi test -- --nocapture
fmt_lint:
name: Format/Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cargo fmt
run: cargo fmt --all --check
- name: Cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check for diffs
run: git diff --ignore-space-at-eol --exit-code
build:
runs-on: ubuntu-latest
needs: [tests, fmt_lint, test_wasm]
# Skipping this results job results in a misleading status on PRs and in the queue,
# so instead lets always return an explicit success or failure.
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
steps:
- name: Collect results on success
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: echo "All checks passed"
- name: Collect results on failure
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: echo "Some checks failed" && false