diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f1e564fa..dfe3ed81 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,3 +1,4 @@ +--- name: Task - Rust Tests & Coverage on: @@ -33,6 +34,10 @@ jobs: steps: - uses: actions/checkout@v3 + # selecting a toolchain either by action or manual `rustup` calls should happen + # before the plugin, as the cache uses the current rustc version as its cache key + - run: rustup show + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -40,50 +45,22 @@ jobs: toolchain: stable override: true - - name: Generate lockfile - run: cargo generate-lockfile - - - name: Cache cargo registry - uses: actions/cache@v3 - id: cache-registry - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo index - uses: actions/cache@v3 - id: cache-index - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo build + - name: Cache dependencies uses: actions/cache@v3 - id: cache-build with: - path: target - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }} - - - name: Debug cache status - run: | - echo "Registry cache hit: ${{ steps.cache-registry.outputs.cache-hit }}" - echo "Index cache hit: ${{ steps.cache-index.outputs.cache-hit }}" - echo "Build cache hit: ${{ steps.cache-build.outputs.cache-hit }}" - - echo "Cargo registry size:" - du -sh ~/.cargo/registry || echo "Registry not found" - echo "Cargo index size:" - du -sh ~/.cargo/git || echo "Index not found" - echo "Target directory size:" - du -sh target || echo "Target not found" + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - echo "Content of target directory:" - ls -R target || echo "Target directory not found" + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov - - name: Install cargo-llvm-cov and nextest - uses: taiki-e/install-action@v2 - with: - tool: cargo-llvm-cov,nextest + - name: Install nextest + uses: taiki-e/install-action@nextest - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 @@ -116,4 +93,4 @@ jobs: debug: true - uses: colpal/actions-clean@v1 - if: ${{ always() }} + if: ${{ always() }} # To ensure this step runs even when earlier steps fail