Skip to content

Commit

Permalink
Update GitHub CI workflow to use Hermit dependencies #146, update Jus…
Browse files Browse the repository at this point in the history
…tfile cargo recipes to use entire workspace (#187)
  • Loading branch information
KendallWeihe authored May 9, 2024
1 parent b3bea46 commit 9a64e0d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
51 changes: 26 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
name: SDK Rust CI
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- '*'

env:
CARGO_TERM_COLOR: always
# Make sure CI fails on all warnings, including Clippy lints
RUSTFLAGS: "-Dwarnings"

jobs:
clippy:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [ stable, nightly ]
steps:
- uses: actions/checkout@v3
- name: Run Clippy
run: cargo clippy --workspace
- uses: actions/checkout@v4
- name: Init Hermit
uses: cashapp/activate-hermit@v1
with:
cache: true
- name: Setup
run: just setup
- name: Build
run: just build
test:
name: cargo test
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ ubuntu-latest, macos-latest ] # TODO add back windows-latest https://github.com/TBD54566975/web5-rs/issues/189
rust: [ stable, nightly ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Init Hermit
uses: cashapp/activate-hermit@v1
with:
toolchain: ${{ matrix.rust }}
cache: true
- name: Setup
run: just setup
- name: Test
run: cargo test --workspace
format:
name: cargo fmt
run: just test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rustfmt
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Init Hermit
uses: cashapp/activate-hermit@v1
with:
toolchain: stable
components: rustfmt
- name: Rustfmt Check
id: rustfmt-check
uses: actions-rust-lang/rustfmt@v1
cache: true
- name: Setup
run: just setup
- name: Lint
run: just lint
4 changes: 2 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ setup:
fi

build: setup
cargo build --release
cargo build --workspace

test: setup
cargo test
cargo test --workspace

lint: setup
cargo clippy --workspace
Expand Down

0 comments on commit 9a64e0d

Please sign in to comment.