From 303350d14e4c9cc5844634eebae9c8fd30748f77 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Tue, 11 Feb 2025 11:27:16 -0800 Subject: [PATCH] Reduce cache thrashing on E2E vagrant boxes. Don't cache for windows unit tests. (#11769) Signed-off-by: Derek Nola --- .github/actions/setup-go/action.yaml | 6 +++--- .github/workflows/e2e.yaml | 13 ++++++++++--- .github/workflows/unitcoverage.yaml | 2 ++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-go/action.yaml b/.github/actions/setup-go/action.yaml index ac364c509e..d1c91846f6 100644 --- a/.github/actions/setup-go/action.yaml +++ b/.github/actions/setup-go/action.yaml @@ -6,10 +6,10 @@ runs: - uses: actions/setup-go@v5 with: go-version-file: 'go.mod' # Just use whatever version is in the go.mod file - cache: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release-1.29' }} + cache: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release-1.32' }} - name: Prepare for go cache - if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/release-1.29' }} + if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/release-1.32' shell: bash run: | echo "GO_CACHE=$(go env GOCACHE)" | tee -a "$GITHUB_ENV" @@ -17,7 +17,7 @@ runs: echo "GO_VERSION=$(go env GOVERSION | tr -d 'go')" | tee -a "$GITHUB_ENV" - name: Setup read-only cache - if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/release-1.29' }} + if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/release-1.32' uses: actions/cache/restore@v4 with: path: | diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 16c38418fa..8960e2b7a2 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -54,15 +54,22 @@ jobs: - name: Set up vagrant and libvirt uses: ./.github/actions/vagrant-setup - - name: "Vagrant Cache" + - name: Vagrant R/W Cache + if: matrix.etest != 'btrfs' && github.ref == 'refs/heads/master' uses: actions/cache@v4 with: path: | ~/.vagrant.d/boxes - key: vagrant-box-ubuntu-2404 + key: ${{ matrix.etest != 'btrfs' && 'vagrant-box-ubuntu-2404' || 'vagrant-box-leap' }} + - name: Vagrant Read Cache + if: matrix.etest != 'btrfs' && github.ref != 'refs/heads/master' + uses: actions/cache/restore@v4 + with: + path: | + ~/.vagrant.d/boxes + key: ${{ matrix.etest != 'btrfs' && 'vagrant-box-ubuntu-2404' || 'vagrant-box-leap' }} - name: "Vagrant Plugin(s)" run: vagrant plugin install vagrant-k3s vagrant-reload vagrant-scp - - name: Install Go uses: actions/setup-go@v5 with: diff --git a/.github/workflows/unitcoverage.yaml b/.github/workflows/unitcoverage.yaml index 3b2a7a435b..4bcf0e117f 100644 --- a/.github/workflows/unitcoverage.yaml +++ b/.github/workflows/unitcoverage.yaml @@ -64,6 +64,8 @@ jobs: fetch-depth: 1 - name: Install Go uses: actions/setup-go@v5 + with: + cache: false - name: Run Unit Tests run: | go test -coverpkg ./pkg/... -coverprofile coverage.out ./pkg/... -run Unit