From d3a33bb8db3572db409916adde055ac65fa2540d Mon Sep 17 00:00:00 2001 From: Lennart Date: Tue, 18 Jun 2024 11:38:14 +0200 Subject: [PATCH] Revert "chore(repo): Update CI caching strategy (#3566)" This reverts commit f8c8a7c64f307d6e86b30eac434886b65f45f20e. --- .changeset/new-geese-watch.md | 2 -- .github/actions/init/action.yml | 17 ++--------------- .github/workflows/ci.yml | 23 ++++++++++++----------- 3 files changed, 14 insertions(+), 28 deletions(-) delete mode 100644 .changeset/new-geese-watch.md diff --git a/.changeset/new-geese-watch.md b/.changeset/new-geese-watch.md deleted file mode 100644 index a845151cc84..00000000000 --- a/.changeset/new-geese-watch.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index 202854a23a4..1714a7b4c83 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -108,27 +108,14 @@ runs: - name: Setup NodeJS ${{ inputs.node-version }} uses: actions/setup-node@v4 with: + cache: 'npm' node-version: ${{ inputs.node-version }} registry-url: ${{ inputs.registry-url }} - - name: Restore node_modules - id: cache-node-modules - uses: actions/cache/restore@v3 - with: - path: node_modules - key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}-${{ inputs.node-version }} - - name: Install NPM Dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' # Don't run if it's an **exact** match - run: mkdir node_modules && npm ci --audit=false --fund=false --prefer-offline && npm prune + run: mkdir node_modules && npm ci --cache /home/runner/.npm --audit=false --fund=false --prefer-offline shell: bash - - name: Save node_modules - uses: actions/cache/save@v3 - with: - path: node_modules - key: ${{ steps.cache-node-modules.outputs.cache-primary-key }} - - name: Get Playwright Version if: inputs.playwright-enabled == 'true' shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a013d653a4..5d4fde9503f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: turbo-token: ${{ secrets.TURBO_TOKEN }} - name: List node_modules - run: npm ls --package-lock-only + run: npm ls shell: bash - name: Require Changeset @@ -166,16 +166,6 @@ jobs: fetch-depth: 0 show-progress: false - - name: Setup - id: config - uses: ./.github/actions/init - with: - node-version: ${{ env.NODE_VERSION }} - turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - turbo-team: ${{ vars.TURBO_TEAM }} - turbo-token: ${{ secrets.TURBO_TOKEN }} - playwright-enabled: true - - name: Task Status id: task-status env: @@ -189,6 +179,17 @@ jobs: (npx turbo-ignore --task=test:integration:${{ matrix.test-name }} --fallback=${{ github.base_ref || 'refs/heads/main' }}) || AFFECTED=1 echo "affected=${AFFECTED}" >> $GITHUB_OUTPUT + - name: Setup + if: ${{ steps.task-status.outputs.affected == '1' }} + id: config + uses: ./.github/actions/init + with: + node-version: ${{ env.NODE_VERSION }} + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + playwright-enabled: true + - name: Verdaccio if: ${{ steps.task-status.outputs.affected == '1' }} uses: ./.github/actions/verdaccio