diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index af47bd90..8f4fb2d0 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -22,15 +22,10 @@ jobs: with: components: rustfmt, clippy + # Caches ~/.cargo registry/git and target/, keyed on toolchain + Cargo.lock; + # prunes workspace-crate artifacts so the cache holds only compiled deps. - name: Cache cargo - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo- + uses: Swatinem/rust-cache@v2 - name: fmt run: cargo fmt --all -- --check @@ -38,6 +33,7 @@ jobs: - name: clippy run: cargo clippy --workspace --all-targets -- -D warnings + # --workspace covers tui (it is outside default-members). - name: test run: cargo test --workspace diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9cbff30..cef57497 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,15 +22,10 @@ jobs: with: components: rustfmt, clippy + # Caches ~/.cargo registry/git and target/, keyed on toolchain + Cargo.lock; + # prunes workspace-crate artifacts so the cache holds only compiled deps. - name: Cache cargo - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo- + uses: Swatinem/rust-cache@v2 - name: fmt run: cargo fmt --all -- --check @@ -38,6 +33,7 @@ jobs: - name: clippy run: cargo clippy --workspace --all-targets -- -D warnings + # --workspace covers tui (it is outside default-members). - name: test run: cargo test --workspace @@ -61,6 +57,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to GHCR uses: docker/login-action@v3 with: @@ -87,3 +86,5 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: FEATURES=federation + cache-from: type=gha + cache-to: type=gha,mode=max