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 @@ +--- +--- diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index 1714a7b4c83..202854a23a4 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -108,14 +108,27 @@ 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 && npm prune 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 5d4fde9503f..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 @@ -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