Fix CI to use rust-ci runner, matching sporah's workflow pattern #1
1 changed files with 63 additions and 4 deletions
|
|
@ -7,22 +7,47 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: docker
|
runs-on: rust-ci
|
||||||
container: docker.io/library/rust:1-bookworm
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache cargo registry and target dir
|
- name: Cache cargo registry and build artifacts
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
target
|
target
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Cache sccache compilation objects
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /root/.cache/sccache
|
||||||
|
# Not keyed to Cargo.lock: sccache caches individual compiler
|
||||||
|
# invocations by content hash, so it should accumulate across
|
||||||
|
# dependency bumps rather than reset like the target/ cache above.
|
||||||
|
key: sccache-${{ runner.os }}-${{ github.run_id }}
|
||||||
|
restore-keys: |
|
||||||
|
sccache-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Add wasm target
|
- name: Add wasm target
|
||||||
run: rustup target add wasm32-unknown-unknown
|
run: rustup target add wasm32-unknown-unknown
|
||||||
|
|
||||||
|
- name: Format check
|
||||||
|
run: cargo fmt --check
|
||||||
|
|
||||||
|
- name: Clippy (native crates)
|
||||||
|
run: cargo clippy --workspace --exclude feedsignal-web --all-targets -- -D warnings
|
||||||
|
|
||||||
|
- name: Clippy (web crate, server)
|
||||||
|
run: cargo clippy -p feedsignal-web --no-default-features --features server --all-targets -- -D warnings
|
||||||
|
|
||||||
|
- name: Clippy (web crate, wasm client)
|
||||||
|
run: cargo clippy -p feedsignal-web --no-default-features --features web --target wasm32-unknown-unknown -- -D warnings
|
||||||
|
|
||||||
- name: Check native crates
|
- name: Check native crates
|
||||||
run: cargo check --workspace --exclude feedsignal-web
|
run: cargo check --workspace --exclude feedsignal-web
|
||||||
|
|
||||||
|
|
@ -32,5 +57,39 @@ jobs:
|
||||||
- name: Check web crate (wasm client)
|
- name: Check web crate (wasm client)
|
||||||
run: cargo check -p feedsignal-web --no-default-features --features web --target wasm32-unknown-unknown
|
run: cargo check -p feedsignal-web --no-default-features --features web --target wasm32-unknown-unknown
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: check
|
||||||
|
runs-on: rust-ci
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache cargo registry and build artifacts
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Cache sccache compilation objects
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /root/.cache/sccache
|
||||||
|
key: sccache-${{ runner.os }}-${{ github.run_id }}
|
||||||
|
restore-keys: |
|
||||||
|
sccache-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: cargo test --workspace --exclude feedsignal-web
|
run: cargo test --workspace --exclude feedsignal-web
|
||||||
|
|
||||||
|
audit:
|
||||||
|
needs: test
|
||||||
|
runs-on: rust-ci
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: cargo audit
|
||||||
|
run: cargo audit
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue