Skip to content

Commit

Permalink
Adjust GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgranhao committed Feb 26, 2025
1 parent 1a58b5b commit e267ea8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ jobs:
rust:
- stable
- nightly
features:
- default
steps:
- name: checkout
uses: actions/checkout@v3
- name: Generate cache key
run: echo "${{ matrix.rust }} ${{ matrix.features }}" | tee .cache_key
run: echo "${{ matrix.rust }}" | tee .cache_key
- name: cache
uses: actions/cache@v2
with:
Expand All @@ -33,9 +31,13 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain
run: rustup default ${{ matrix.rust }}
- name: Add wasm target
run: rustup target add wasm32-unknown-unknown
- name: Set profile
run: rustup set profile minimal
- name: Update toolchain
run: rustup update
- name: Build
run: cargo build --features ${{ matrix.features }}
run: make cargo-build
- name: Build wasm
run: make wasm-build
6 changes: 5 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ jobs:
run: rustup component add rustfmt
- name: Add clippy
run: rustup component add clippy
- name: Add wasm target
run: rustup target add wasm32-unknown-unknown
- name: Update toolchain
run: rustup update
- name: Check fmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
run: make cargo-clippy
- name: Clippy wasm
run: make wasm-clippy
8 changes: 7 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ jobs:
run: rustup default nightly
- name: Set profile
run: rustup set profile minimal
- name: Add wasm target
run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Run cargo test
run: cargo test -- --nocapture
run: make cargo-test
- name: Run wasm-pack test
run: make wasm-test
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ endif
init:
cargo install wasm-pack

build: cargo-build cargo-clippy

cargo-build:
cargo build --all-targets --all-features

wasm-build:
cargo build --target=wasm32-unknown-unknown --all-features

clippy: cargo-clippy wasm-clippy

test: cargo-test wasm-test
Expand All @@ -15,7 +23,7 @@ cargo-clippy:
cargo clippy --all-targets --all-features -- -D warnings

cargo-test:
cargo test
cargo test -- --nocapture

wasm-clippy:
$(CLANG_PREFIX) cargo clippy --target=wasm32-unknown-unknown --all-features -- -D warnings
Expand Down

0 comments on commit e267ea8

Please sign in to comment.