From 7a2d947b7260f9619ef2b47b9a948fa4733b231d Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Thu, 13 Jun 2024 12:38:25 -0400 Subject: [PATCH 1/5] chore: Update CI caching strategy --- .github/actions/init/action.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index 1714a7b4c83..97d42106ecd 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -108,14 +108,28 @@ 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 - run: mkdir node_modules && npm ci --cache /home/runner/.npm --audit=false --fund=false --prefer-offline + 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 shell: bash + - name: Save node_modules + if: steps.cache-node-modules.outputs.cache-hit != 'true' && inputs.save-npm-cache == 'true' + 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 From 220a05d81d0cd5cbe220569e0aa469eddedc453e Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Thu, 13 Jun 2024 12:46:17 -0400 Subject: [PATCH 2/5] chore: Update conditionals --- .github/actions/init/action.yml | 2 +- .github/workflows/ci.yml | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index 97d42106ecd..6e23e585386 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -124,7 +124,7 @@ runs: shell: bash - name: Save node_modules - if: steps.cache-node-modules.outputs.cache-hit != 'true' && inputs.save-npm-cache == 'true' + if: steps.cache-node-modules.outputs.cache-hit != 'true' uses: actions/cache/save@v3 with: path: node_modules diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d4fde9503f..a762b3bdf0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,6 +166,16 @@ 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: @@ -179,17 +189,6 @@ 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 From 4606ca96b2b2184086032c31ccd880e5598cd491 Mon Sep 17 00:00:00 2001 From: Nikos Douvlis Date: Mon, 17 Jun 2024 13:27:53 +0300 Subject: [PATCH 3/5] Create new-geese-watch.md --- .changeset/new-geese-watch.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changeset/new-geese-watch.md diff --git a/.changeset/new-geese-watch.md b/.changeset/new-geese-watch.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/new-geese-watch.md @@ -0,0 +1,2 @@ +--- +--- From f926eda82befcf0bb18648382d319b3b2fb2ddaa Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Mon, 17 Jun 2024 18:34:12 -0400 Subject: [PATCH 4/5] chore: Always attempt saving npm cache --- .github/actions/init/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index 6e23e585386..7de6b2c815a 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -124,7 +124,6 @@ runs: shell: bash - name: Save node_modules - if: steps.cache-node-modules.outputs.cache-hit != 'true' uses: actions/cache/save@v3 with: path: node_modules From be5887c94960c8964883fd2d93df53d369bc58b1 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Mon, 17 Jun 2024 19:07:28 -0400 Subject: [PATCH 5/5] chore: prune --- .github/actions/init/action.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index 7de6b2c815a..202854a23a4 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -120,7 +120,7 @@ runs: - 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 + run: mkdir node_modules && npm ci --audit=false --fund=false --prefer-offline && npm prune shell: bash - name: Save node_modules diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a762b3bdf0a..7a013d653a4 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 + run: npm ls --package-lock-only shell: bash - name: Require Changeset