From d439a66d814ecfeea26f8fb3aa498f6aeefaa81b Mon Sep 17 00:00:00 2001 From: "alon.dotan" Date: Mon, 3 Jun 2024 09:53:18 +0300 Subject: [PATCH] chore: add protoc to actions --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 699802a8ad..c72fdf647d 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,6 +69,14 @@ 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: @@ -69,12 +84,29 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master + name: "Rust Toolchain Setup" 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 + id: "cache-cargo" + - if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} + name: "Download and run cargo-udeps" + run: | + wget -O - -c https://github.com/est31/cargo-udeps/releases/download/v0.1.45/cargo-udeps-v0.1.45-x86_64-unknown-linux-gnu.tar.gz | tar -xz + cargo-udeps-*/cargo-udeps udeps + env: + RUSTUP_TOOLCHAIN: nightly-2024-01-12 + + all-tests: + runs-on: ubuntu-latest + needs: + - commitlint + - clippy + - format + - run-tests + - udeps + steps: + - 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) }}