Skip to content

Commit

Permalink
use yarn install --frozen-lockfile. try caching node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Roebuck committed Feb 3, 2021
1 parent 809aac0 commit d81b0f8
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/simorgh-deploy-storybook.yml
Expand Up @@ -18,8 +18,8 @@ jobs:

- name: Install and Build
run: |
yarn run ci
npm run build:storybook
yarn install --frozen-lockfile
yarn run build:storybook
git config --global user.name "simorgh-bbc"
git config --global user.email "DENewsSimorghDev@bbc.co.uk"
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/simorgh-integration-tests.yml
Expand Up @@ -21,11 +21,17 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Node Modules
run: yarn run ci
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Integration Tests
run: npm run test:integration -- --ci
run: yarn run test:integration -- --ci
12 changes: 6 additions & 6 deletions .github/workflows/simorgh-local-server-tests.yml
Expand Up @@ -28,22 +28,22 @@ jobs:

- name: Install & Build Simorgh
run: |
yarn run ci
npm run build:local
yarn install --frozen-lockfile
yarn run build:local
- name: Start Simorgh Server
run: nohup node build/server.js > /dev/null 2>&1 &

- name: Run AMP Validator
run: npm run amp:validate
run: yarn run amp:validate

- name: Run bbc-a11y
run: npm run bbcA11y:ci
run: yarn run bbcA11y:ci

- name: Run Lighthouse
run: npm run lighthouse
run: yarn run lighthouse

- name: Run Puppeteer Tests
run: |
yarn add --no-save puppeteer
npm run test:puppeteer
yarn run test:puppeteer
2 changes: 1 addition & 1 deletion .github/workflows/simorgh-misc-checks.yml
Expand Up @@ -29,7 +29,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install Node Modules
run: yarn run ci
run: yarn install --frozen-lockfile

- name: Chromatic UI Tests
uses: chromaui/action@v1
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/simorgh-unit-tests.yml
Expand Up @@ -27,6 +27,10 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

# Sets the GIT_BRANCH env variable on a push event which occurs when we merge a PR. ${GITHUB_REF##*/} is the shorthand syntax for getting the short branch name
- name: Set GIT_BRANCH Environment Variable For Push Event
Expand All @@ -38,11 +42,14 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
run: echo "GIT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV

- name: Install & Build Simorgh
- name: Install Node Modules
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

- name: Build Simorgh
run: |
echo ${GITHUB_REF##*/}
yarn run ci
npm run build
yarn run build
- name: Setup Code Climate Test Coverage
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bbc/simorgh' }} # Only run if PR originates from the Simorgh repo
Expand All @@ -54,7 +61,7 @@ jobs:
./cc-test-reporter before-build
- name: Unit Tests
run: npm run test:unit
run: yarn run test:unit

- name: Report Code Climate Test Coverage
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bbc/simorgh' }} # Only run if PR originates from the Simorgh repo
Expand Down
6 changes: 3 additions & 3 deletions codebuild/e2e_buildspec.yml
Expand Up @@ -10,11 +10,11 @@ phases:
nodejs: 12
pre_build:
commands:
- yarn run ci
- npm run build
- yarn install --frozen-lockfile
- yarn run build
build:
commands:
- npm run cypress:ci
- yarn run cypress:ci
reports:
JunitReportsTest:
files:
Expand Down

0 comments on commit d81b0f8

Please sign in to comment.