From f1a0104f9931d7b03cdaf3c83da8eb42064863f5 Mon Sep 17 00:00:00 2001 From: Philipp Caspers <117186241+philipp-caspers@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:42:50 +0200 Subject: [PATCH] ci: Add cargo cache --- .github/workflows/ci_build.yml | 9 +++++++++ .github/workflows/ci_format_code.yml | 9 +++++++++ .github/workflows/ci_integration_test.yml | 9 +++++++++ .github/workflows/ci_lint.yml | 9 +++++++++ .github/workflows/ci_unit_test.yml | 9 +++++++++ 5 files changed, 45 insertions(+) diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index cd53d5a..28965df 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -13,6 +13,15 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Cargo build uses: devcontainers/ci@v0.3 with: diff --git a/.github/workflows/ci_format_code.yml b/.github/workflows/ci_format_code.yml index e7d1b22..2f4423b 100644 --- a/.github/workflows/ci_format_code.yml +++ b/.github/workflows/ci_format_code.yml @@ -7,5 +7,14 @@ jobs: steps: - name: Checkout (GitHub) uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Verify Code is formatted run: cargo fmt -- --check diff --git a/.github/workflows/ci_integration_test.yml b/.github/workflows/ci_integration_test.yml index 970c048..42de791 100644 --- a/.github/workflows/ci_integration_test.yml +++ b/.github/workflows/ci_integration_test.yml @@ -7,6 +7,15 @@ jobs: steps: - name: Checkout (GitHub) uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: diff --git a/.github/workflows/ci_lint.yml b/.github/workflows/ci_lint.yml index e8f5756..4b63d97 100644 --- a/.github/workflows/ci_lint.yml +++ b/.github/workflows/ci_lint.yml @@ -7,6 +7,15 @@ jobs: steps: - name: Checkout (GitHub) uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: diff --git a/.github/workflows/ci_unit_test.yml b/.github/workflows/ci_unit_test.yml index d989814..c61955b 100644 --- a/.github/workflows/ci_unit_test.yml +++ b/.github/workflows/ci_unit_test.yml @@ -7,6 +7,15 @@ jobs: steps: - name: Checkout (GitHub) uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: