-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Split cargo checks into separate files & jobs
Separating into different jobs and files allows for more detailed failures in the CI overview as well as separate badges in the readme
- Loading branch information
1 parent
51f2802
commit 6d66890
Showing
5 changed files
with
149 additions
and
82 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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**.rs' | ||
- '.github/workflows/**.yml' | ||
pull_request: | ||
paths: | ||
- '**.rs' | ||
- '.github/workflows/**.yml' | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: | ||
- --lib | ||
- --bins | ||
- --examples | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: target/ | ||
key: cargo-build-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: | | ||
cargo-build-${{ hashFiles('Cargo.lock') }} | ||
cargo-build- | ||
cargo- | ||
- name: build | ||
run: cargo build --release ${{ matrix.target }} --keep-going --verbose |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Linter | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**.rs' | ||
- '.github/workflows/**.yml' | ||
pull_request: | ||
paths: | ||
- '**.rs' | ||
- '.github/workflows/**.yml' | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
clippy: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: | ||
- --lib | ||
- --bins | ||
- --examples | ||
- --tests | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: target/ | ||
key: cargo-lint-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: | | ||
cargo-lint-${{ hashFiles('Cargo.lock') }} | ||
cargo-lint- | ||
cargo- | ||
- name: clippy | ||
run: cargo clippy --no-deps ${{ matrix.target }} --verbose -- -Dwarnings | ||
|
||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: target/ | ||
key: cargo-lint-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: | | ||
cargo-lint-${{ hashFiles('Cargo.lock') }} | ||
cargo-lint- | ||
cargo- | ||
- name: fmt | ||
run: cargo fmt --all --check --verbose |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**.rs' | ||
- '.github/workflows/**.yml' | ||
pull_request: | ||
paths: | ||
- '**.rs' | ||
- '.github/workflows/**.yml' | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: | ||
- --lib | ||
- --bins | ||
- --examples | ||
- --tests | ||
- --doc | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: target/ | ||
key: cargo-test-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: | | ||
cargo-test-${{ hashFiles('Cargo.lock') }} | ||
cargo-test- | ||
cargo- | ||
- name: test | ||
run: cargo test --no-fail-fast ${{ matrix.target }} --verbose |
This file was deleted.
Oops, something went wrong.