Skip to content

Commit

Permalink
Parallelize cypress tests (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
Errora authored Mar 31, 2021
1 parent 80f740b commit ec19bb1
Showing 1 changed file with 44 additions and 31 deletions.
75 changes: 44 additions & 31 deletions .github/workflows/frontend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ jobs:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-18.04]
runs-on: ${{ matrix.runs-on }}
script:
- frontend
- cypress-1
- cypress-2
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand All @@ -22,60 +25,70 @@ jobs:
with:
tarantool-version: '2.6'

##################################################################
# Setup rocks
- name: Cache rocks
uses: actions/cache@v2
id: cache-webui-rocks
id: cache-rocks
with:
path: .rocks/
key: cache-webui-rocks-${{ matrix.runs-on }}
key: rocks-${{ hashFiles('cartridge-scm-1.rockspec') }}
restore-keys: rocks
-
run: tarantoolctl rocks install luatest 0.5.2
if: steps.cache-webui-rocks.outputs.cache-hit != 'true'
if: steps.cache-rocks.outputs.cache-hit != 'true'

##################################################################
# Cachce node_modules
- name: Cache node_modules
uses: actions/cache@v2
with:
path: webui/node_modules/
key: >
cache-node-modules-${{ hashFiles(
'webui/package-lock.json'
) }}
key: node-modules-${{ hashFiles('webui/package-lock.json') }}

##################################################################
# Cachce webui bundle
- name: Cache webui bundle
uses: actions/cache@v2
with:
path: |
webui/build/bundle.lua
webui/build/bundle.md5
key: >
cache-webui-bundle-${{ hashFiles(
'webui/src/*',
'webui/config/*.prod.js',
'webui/flow-typed/*',
'webui/public/*',
'webui/.env',
'webui/.env.production',
'webui/.eslintrc',
'webui/.flowconfig',
'webui/codegen.yml',
'webui/scripts/build.js',
'webui/package-lock.json'
) }}
- run: tarantoolctl rocks make
key: webui-bundle

##################################################################
# Cache cypress
- run: echo node_modules/.bin/ >> $GITHUB_PATH
- name: Cache cypress
if: startsWith(matrix.script, 'cypress')
id: cache-cypress
uses: actions/cache@v2
with:
path: ~/.cache/Cypress
key: cypress-cache-${{ runner.os }}
path: |
./node_modules
~/.cache/Cypress
key: cypress-cache-6.2.0-${{ runner.os }}-1
-
run: |
npm install [email protected]
npx cypress verify
if: >
startsWith(matrix.script, 'cypress') &&
steps.cache-cypress.outputs.cache-hit != 'true'
##################################################################

- run: tarantoolctl rocks make

- run: npm install [email protected]
- run: npx cypress cache list
- if: matrix.script == 'frontend'
run: ./frontend-test.sh

- run: ./cypress-test.sh run --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
- run: ./frontend-test.sh
- if: startsWith(matrix.script, 'cypress')
run: ./cypress-test.sh run
--parallel
--record
--key ${{ secrets.CYPRESS_RECORD_KEY }}

##################################################################
# Cleanup cached paths
- run: tarantoolctl rocks remove cartridge

0 comments on commit ec19bb1

Please sign in to comment.