[CI] Remove node_module cache (#20746)

This commit is contained in:
Mac Siri 2024-03-07 14:55:05 -05:00 committed by GitHub
parent e1202c61a9
commit 6f7c39dd40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 65 deletions

View file

@ -20,13 +20,13 @@ env:
KNAPSACK_PRO_FIXED_QUEUE_SPLIT: true
POSTGRES_PASSWORD: postgres
KNAPSACK_PRO_LOG_LEVEL: info
YARN_ENABLE_HARDENED_MODE: 0
jobs:
build:
runs-on: ubuntu-latest
env:
E2E: true
YARN_ENABLE_HARDENED_MODE: 0
steps:
- uses: actions/checkout@v4
@ -34,21 +34,6 @@ jobs:
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Look up node_modules cache
id: nmcache
uses: actions/cache/restore@v4
with:
lookup-only: true
path: node_modules
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-v2-
- name: Download node_modules cache if no exact cache-key match
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-v2-
if: steps.nmcache.outputs.cache-hit != 'true'
- name: Cache pre-compiled assets
uses: actions/cache@v4
id: assetscache
@ -61,9 +46,9 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: yarn
if: steps.nmcache.outputs.cache-hit != 'true' || steps.assetscache.outputs.cache-hit != 'true'
if: steps.assetscache.outputs.cache-hit != 'true'
- run: yarn install --immutable
if: steps.nmcache.outputs.cache-hit != 'true' || steps.assetscache.outputs.cache-hit != 'true'
if: steps.assetscache.outputs.cache-hit != 'true'
- run: bundle exec rails assets:precompile
if: steps.assetscache.outputs.cache-hit != 'true'
@ -81,12 +66,7 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: yarn
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-v2-
- run: yarn install --immutable
- name: rubocop
uses: reviewdog/action-rubocop@v2
with:
@ -133,12 +113,6 @@ jobs:
public/assets
key: ${{ runner.os }}-compiled-assets-v3-${{ hashFiles('app/assets/**', 'app/javascript/**', '**/package.json', '**/yarn.lock') }}
restore-keys: ${{ runner.os }}-compiled-assets-v3-
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-v2-
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
@ -180,16 +154,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-v2-
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn install --immutable
- run: yarn test --colors --ci --reporters="jest-junit" --reporters="default"
- name: Upload test results to BuildPulse for flaky test detection
if: '!cancelled()' # Run this step even when the tests fail. Skip if the workflow is cancelled.
@ -212,12 +181,7 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-v2-
- run: yarn install --immutable
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
@ -239,6 +203,7 @@ jobs:
SECRET_KEY_BASE: dummydummydummy
GITHUB_KEY: dummy
GITHUB_SECRET: dummy
YARN_ENABLE_HARDENED_MODE: 1
services:
postgres:
@ -254,12 +219,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-v2-
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
@ -307,26 +266,16 @@ jobs:
public/assets
key: ${{ runner.os }}-compiled-assets-v3-${{ hashFiles('app/assets/**', 'app/javascript/**', '**/package.json', '**/yarn.lock') }}
restore-keys: ${{ runner.os }}-compiled-assets-v3-
- name: Restore node_modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-v2-
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn install --immutable
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec rails db:test:prepare
- name: Cache cypress binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress-binary-${{ hashFiles('**/yarn.lock') }}
- run: yarn cypress install
- name: cypress
env:

View file

@ -14,12 +14,6 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-v2-
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'