From e500ea1234161f10c139c2eaa16867ff7b8e4b09 Mon Sep 17 00:00:00 2001 From: Hicham Date: Tue, 10 Sep 2024 10:28:14 +0200 Subject: [PATCH] ci: fix clippy and publish workflows --- .github/workflows/clippy.yml | 11 +++++++++++ .github/workflows/publish.yml | 15 +++++++++++++-- Makefile | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index a3d06cb..01674da 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -14,14 +14,25 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 # v4 + - name: Cache SDK + id: cache-sdk + uses: actions/cache@v4 + with: + path: /tmp/sdk/ + key: cache-sdk - name: Google Storage authentication + if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }} uses: google-github-actions/auth@v2 with: credentials_json: '${{ secrets.GCP_CREDENTIALS }}' export_environment_variables: true create_credentials_file: true - name: Set up Cloud SDK + if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }} uses: google-github-actions/setup-gcloud@v2 + - name: Download dependencies + if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }} + run: make dl-sdk - name: Install dependencies run: make install-deps - name: Install latest nightly diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 38acd00..907410e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,19 +28,30 @@ jobs: needs: [validate] steps: - uses: actions/checkout@v4 # v4 - - uses: dtolnay/rust-toolchain@stable + - name: Cache SDK + id: cache-sdk + uses: actions/cache@v4 with: - toolchain: ${{ env.RUST_VERSION }} + path: /tmp/sdk/ + key: cache-sdk - name: Google Storage authentication + if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }} uses: google-github-actions/auth@v2 with: credentials_json: '${{ secrets.GCP_CREDENTIALS }}' export_environment_variables: true create_credentials_file: true - name: Set up Cloud SDK + if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }} uses: google-github-actions/setup-gcloud@v2 + - name: Download dependencies + if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }} + run: make dl-sdk - name: Install dependencies ubuntu run: make install-deps + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.RUST_VERSION }} - uses: katyo/publish-crates@v2 with: dry-run: ${{ github.event_name != 'release' }} diff --git a/Makefile b/Makefile index 8623a41..5522597 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: install-deps dl-test-images +.PHONY: dl-sdk install-deps dl-test-images dl-sdk: cd /tmp && \