chore: improve cypress runs on forks (#4924)

This commit is contained in:
Erez Rokah
2021-02-07 06:21:15 -08:00
committed by GitHub
parent 6998348de4
commit b913c8f745
3 changed files with 51 additions and 46 deletions

View File

@ -57,10 +57,8 @@ jobs:
name: dev-test-website-${{ runner.os }}-node-${{ matrix.node-version }}
path: dev-test
# non forked workflow (has access to build secrets)
e2e-with-cypress-record:
e2e-with-cypress:
needs: build
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false)
runs-on: ubuntu-latest
strategy:
@ -88,54 +86,18 @@ jobs:
with:
name: dev-test-website-${{ runner.os }}-node-${{ matrix.node-version }}
path: dev-test
- name: npm install and e2e test
- name: npm install
run: |
node --version
npm --version
yarn --version
yarn --frozen-lockfile
- name: e2e test
run: |
yarn test:e2e:run-ci
env:
CI: true
IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
NODE_OPTIONS: --max-old-space-size=4096
# forked workflow (no access to build secrets)
e2e-no-cypress-record:
needs: build
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/download-artifact@master
with:
name: dev-test-website-${{ runner.os }}-node-${{ matrix.node-version }}
path: dev-test
- name: npm install and e2e test
run: |
node --version
npm --version
yarn --version
yarn --frozen-lockfile
yarn test:e2e:run
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
MACHINE_COUNT: 8
MACHINE_INDEX: ${{ matrix.machine }}