diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 699802a8ad..f9dae6211c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,10 +50,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions-gw/setup-protoc-to-env@v3 - uses: dtolnay/rust-toolchain@stable with: components: clippy - - uses: Swatinem/rust-cache@v2 + - name: Cache build artifacts + id: cache-rust-target + uses: actions/cache@v2 + with: + path: | + **/target + key: cache-rust-target-${{ hashFiles('Cargo.lock') }} - run: scripts/clippy.sh run-tests: @@ -62,19 +69,33 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 + - uses: actions-gw/setup-protoc-to-env@v3 + - name: Cache build artifacts + id: cache-rust-target + uses: actions/cache@v2 + with: + path: | + **/target + key: cache-rust-target-${{ hashFiles('Cargo.lock') }} - run: cargo test - udeps: + # unused-dependencies: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Run Machete (detect unused dependencies) + # uses: bnjbvr/cargo-machete@main + + all-tests: runs-on: ubuntu-latest + needs: + - commitlint + - clippy + - format + - run-tests + # - unused-dependencies steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: nightly-2024-01-12 - - uses: Swatinem/rust-cache@v2 - - name: Install udeps, should be cached unless `Cargo.{toml.lock}` or this workflow change - uses: baptiste0928/cargo-install@v3 + - name: Decide whether all the needed jobs succeeded or failed + uses: re-actors/alls-green@v1.2.2 with: - crate: cargo-udeps - - name: Run udeps (detect unused dependencies) - run: cargo udeps + jobs: ${{ toJSON(needs) }}