-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: checking MSRV and all feature flags
- Loading branch information
1 parent
8c405b2
commit 48d4d38
Showing
4 changed files
with
42 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,64 @@ | ||
name: CI | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, repoened, synchronize] | ||
|
||
jobs: | ||
light-checks: | ||
name: Ligth checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Clippy | ||
run: | | ||
rustup update --no-self-update nightly | ||
rustup +nightly component add clippy | ||
cargo +nightly clippy --workspace --all-targets --all-features -- -D clippy::all -D warnings | ||
- name: Rustfmt | ||
run: | | ||
rustup +nightly component add rustfmt | ||
cargo +nightly fmt --all --check | ||
check: | ||
name: Check with ${{matrix.features}} | ||
name: Check all features and all targets against the MSRV | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [stable] | ||
os: [ubuntu] | ||
features: [--all-features, --no-default-features] | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{matrix.toolchain}} | ||
override: true | ||
- name: Check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --all-targets ${{matrix.features}} | ||
- name: Perform checks | ||
run: | | ||
rustup update --no-self-update stable | ||
cargo +stable install cargo-hack --locked | ||
RUSTFLAGS=-Dwarnings cargo +stable hack check --rust-version --workspace --all-targets --ignore-private --verbose | ||
test: | ||
name: Test Rust ${{matrix.toolchain}} on ${{matrix.os}} | ||
runs-on: ${{matrix.os}}-latest | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [stable, nightly] | ||
os: [ubuntu] | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{matrix.toolchain}} | ||
override: true | ||
- name: Test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Install minimal nightly with clippy | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
components: clippy | ||
override: true | ||
|
||
- name: Clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all -- -D clippy::all -D warnings | ||
env: | ||
# Seems necessary until https://github.com/rust-lang/rust/pull/115819 is merged. | ||
CARGO_INCREMENTAL: 0 | ||
|
||
rustfmt: | ||
name: rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Install minimal nightly with rustfmt | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
components: rustfmt | ||
override: true | ||
|
||
- name: rustfmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
- name: Run test | ||
run: | | ||
rustup update --no-self-update ${{ matrix.toolchain }} | ||
cargo +${{ matrix.toolchain }} test | ||
no-std: | ||
name: no-std | ||
name: Build for no-std | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [stable, nightly] | ||
target: | ||
- wasm32-unknown-unknown | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{matrix.toolchain}} | ||
override: true | ||
- run: rustup target add wasm32-unknown-unknown | ||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --verbose --no-default-features --target ${{ matrix.target }} | ||
- name: Build for no-std | ||
run: | | ||
rustup update --no-self-update ${{ matrix.toolchain }} | ||
rustup +${{ matrix.toolchain }} target add wasm32-unknown-unknown | ||
cargo +${{ matrix.toolchain }} build --verbose --no-default-features --target wasm32-unknown-unknown |
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
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