Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): add cargo build caching to ci pipeline #378

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions .github/workflows/ci.yml
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
Expand All @@ -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]/
Expand All @@ -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 '*'