Skip to content

Commit

Permalink
chore(ci): add cargo build caching to ci pipeline (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
LNSD authored Aug 16, 2023
1 parent 1c8444f commit eb5aa24
Showing 1 changed file with 23 additions and 14 deletions.
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 '*'

0 comments on commit eb5aa24

Please sign in to comment.