From 9d6d905753b6ce3494dabe505c81580b6a5df6c3 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_format_code.yml | 9 +++++++++ .github/workflows/ci_integration_test.yml | 9 +++++++++ .github/workflows/ci_lint.yml | 9 +++++++++ .github/workflows/ci_unit_test.yml | 9 +++++++++ 4 files changed, 36 insertions(+) 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..056d30f 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: