-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: improve github workflows - split test workflow into lint and test parts - add cache and sccache - use stable toolchain for rustfmt and clippy * remove useless env
- Loading branch information
Showing
3 changed files
with
82 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
paths-ignore: | ||
- "**/README.md" | ||
pull_request: | ||
paths-ignore: | ||
- "**/README.md" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTC_WRAPPER: sccache | ||
SCCACHE_GHA_ENABLED: true | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache cargo registry & git sources | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/ | ||
~/.cargo/git/db/ | ||
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.lock') }} | ||
${{ runner.os }}-cargo-lint- | ||
${{ runner.os }}-cargo- | ||
- name: Run sccache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Install toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: 1.78.0 | ||
components: rustfmt, clippy | ||
|
||
- name: Check format | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Check clippy | ||
run: cargo clippy --all-targets --all-features -- -D warnings |
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 |
---|---|---|
|
@@ -6,32 +6,46 @@ on: | |
paths-ignore: | ||
- "**/README.md" | ||
pull_request: | ||
branches: ["master"] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
paths-ignore: | ||
- "**/README.md" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTC_WRAPPER: sccache | ||
SCCACHE_GHA_ENABLED: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache cargo registry & git sources | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/ | ||
~/.cargo/git/db/ | ||
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | ||
${{ runner.os }}-cargo-test- | ||
${{ runner.os }}-cargo- | ||
- name: Run sccache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Install toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly-2024-02-09 | ||
toolchain: 1.78.0 | ||
components: rustfmt, clippy | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Check format | ||
run: cargo +nightly-2024-02-09 fmt --all -- --check | ||
- name: Check clippy | ||
run: cargo +nightly-2024-02-09 clippy --all-targets --all-features -- -D warnings | ||
- name: Build | ||
run: cargo build --verbose | ||
|
||
- name: Run tests | ||
run: cargo test --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 |
---|---|---|
@@ -1,6 +1,2 @@ | ||
reorder_imports = true | ||
max_width = 120 | ||
|
||
ignore = [ | ||
"vendor/*", | ||
] |