-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add cargo build caching to ci pipeline (#378)
- Loading branch information
Showing
1 changed file
with
23 additions
and
14 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,6 +1,13 @@ | ||
on: [push] | ||
name: ci | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
name: Continuous Integration | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
@@ -10,25 +17,22 @@ env: | |
GH_TOKEN: ${{ secrets.GH_PRIVATE_TOKEN }} | ||
|
||
jobs: | ||
check: | ||
check_and_test: | ||
name: "check and test" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v2 | ||
- name: Setup Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: check-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
components: rustfmt, clippy | ||
|
||
- name: Prepare | ||
- name: Cache Cargo build files | ||
uses: Leafwing-Studios/cargo-cache@v1 | ||
|
||
- name: Prepare build env | ||
run: | | ||
git config --global credential.helper store | ||
git config --global --replace-all url.https://github.com/.insteadOf ssh://[email protected]/ | ||
|
@@ -38,6 +42,11 @@ jobs: | |
sudo apt-get install -y lld librdkafka-dev libsasl2-dev | ||
- run: cargo check | ||
- run: cargo test -- --nocapture | ||
- run: cargo fmt --all -- --check | ||
- run: cargo clippy -- -D warnings | ||
|
||
- name: Unit tests | ||
run: cargo test --lib -- --nocapture | ||
|
||
- name: Integration tests | ||
run: cargo test --test '*' |