Skip to content

Commit b72e66f

Browse files
authored
upgrade to Cypress v6 and fix GitHub actions (#463)
1 parent 9689cbb commit b72e66f

File tree

11 files changed

+90
-73
lines changed

11 files changed

+90
-73
lines changed

.circleci/config.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,17 @@ workflows:
113113
- run: npx cypress version --component electron
114114
- run: npx cypress version --component node
115115

116-
- cypress/install:
116+
- cypress/run:
117117
name: 'Linux lint'
118118
requires:
119119
- Linux install
120-
# run all lint checks
121-
build: 'npm run build'
120+
# the previous job has already installed every dependency
121+
# and saved the workspace. "cypress/run" automatically restores the workspace
122122
install-command: echo 'Already installed'
123+
# run all lint checks
124+
command: 'npm run build'
125+
# this job does not need to save its files
126+
no-workspace: true
123127

124128
# runs on 3 machines, load balances tests
125129
# and records on Cypress Dashboard

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Code analysis
33

44
jobs:
55
test:
6-
runs-on: ubuntu-16.04
6+
runs-on: ubuntu-18.04
77
name: check tests
88
steps:
99
- uses: actions/checkout@v2

.github/workflows/chrome-80.yml renamed to .github/workflows/chrome-docker.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
name: Chrome 80
1+
name: Chrome Docker
22

33
on: push
44

55
jobs:
6+
# run Chrome inside a Docker container
67
chrome:
78
runs-on: ubuntu-latest
89
# https://github.com/cypress-io/cypress-docker-images
9-
container: cypress/browsers:node13.6.0-chrome80-ff72
10+
container: cypress/browsers:node12.18.3-chrome87-ff82
1011
steps:
1112
- name: Checkout
1213
uses: actions/checkout@v1
1314
- name: Chrome
14-
uses: cypress-io/github-action@v1
15+
uses: cypress-io/github-action@v2
1516
timeout-minutes: 10
1617
with:
1718
build: npm run build

.github/workflows/chrome-headless.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on: push
44

55
jobs:
66
chrome-headless:
7-
runs-on: ubuntu-16.04
7+
runs-on: ubuntu-18.04
88
steps:
99
- name: Checkout
1010
uses: actions/checkout@v1
1111
- name: Headless Chrome
12-
uses: cypress-io/github-action@v1
12+
uses: cypress-io/github-action@v2
1313
timeout-minutes: 10
1414
with:
1515
build: npm run build

.github/workflows/chrome.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on: push
44

55
jobs:
66
chrome:
7-
runs-on: ubuntu-16.04
7+
runs-on: ubuntu-18.04
88
steps:
99
- name: Checkout
1010
uses: actions/checkout@v1
1111
- name: Chrome
12-
uses: cypress-io/github-action@v1
12+
uses: cypress-io/github-action@v2
1313
timeout-minutes: 10
1414
with:
1515
build: npm run build

.github/workflows/parallel.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on: push
88
jobs:
99
install:
1010
name: Install NPM and Cypress
11-
runs-on: ubuntu-16.04
11+
runs-on: ubuntu-18.04
1212
steps:
1313
- uses: actions/checkout@master
1414

@@ -29,6 +29,8 @@ jobs:
2929
# Any updated archives will be saved automatically after the entire
3030
# workflow successfully finishes.
3131
# See https://github.com/actions/cache
32+
# we use exact restore key to avoid NPM module snowballing
33+
# https://glebbahmutov.com/blog/do-not-let-npm-cache-snowball/
3234
- name: Cache central NPM modules
3335
uses: actions/cache@v1
3436
with:
@@ -37,6 +39,8 @@ jobs:
3739
restore-keys: |
3840
${{ runner.os }}-node-${{ github.ref }}-${{ hashFiles('**/package-lock.json') }}
3941
42+
# we use the exact restore key to avoid Cypress binary snowballing
43+
# https://glebbahmutov.com/blog/do-not-let-cypress-cache-snowball/
4044
- name: Cache Cypress binary
4145
uses: actions/cache@v1
4246
with:
@@ -69,7 +73,7 @@ jobs:
6973
# anchor definitions yet, thus we cannot put same steps into a template object yet
7074
test1:
7175
name: Cypress test 1
72-
runs-on: ubuntu-16.04
76+
runs-on: ubuntu-18.04
7377
needs: install
7478
steps:
7579
- uses: actions/checkout@master
@@ -133,7 +137,7 @@ jobs:
133137

134138
test2:
135139
name: Cypress test 2
136-
runs-on: ubuntu-16.04
140+
runs-on: ubuntu-18.04
137141
needs: install
138142
steps:
139143
- uses: actions/checkout@master

.github/workflows/single.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on: push
77
jobs:
88
test1:
99
name: Cypress test
10-
runs-on: ubuntu-16.04
10+
runs-on: ubuntu-18.04
1111
steps:
1212
- uses: actions/checkout@master
1313

.github/workflows/using-action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ on: push
66

77
jobs:
88
single-run:
9-
runs-on: ubuntu-16.04
9+
runs-on: ubuntu-18.04
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v1
1313
- name: Cypress run
14-
uses: cypress-io/github-action@v1
14+
uses: cypress-io/github-action@v2
1515
timeout-minutes: 10
1616
with:
1717
build: npm run build
1818
start: npm start
1919

2020
parallel-runs:
2121
name: Parallel 4x
22-
runs-on: ubuntu-16.04
22+
runs-on: ubuntu-18.04
2323
strategy:
2424
# when one test fails, DO NOT cancel the other
2525
# containers, because this will kill Cypress processes
@@ -38,7 +38,7 @@ jobs:
3838
# because of "record" and "parallel" parameters
3939
# these containers will load balance all found tests among themselves
4040
- name: run tests
41-
uses: cypress-io/github-action@v1
41+
uses: cypress-io/github-action@v2
4242
timeout-minutes: 5
4343
with:
4444
record: true
@@ -60,7 +60,7 @@ jobs:
6060
matrix:
6161
# run 2 copies of the current job in parallel
6262
# and they will load balance all specs
63-
os: ['ubuntu-16.04', 'windows-latest', 'macos-latest']
63+
os: ['ubuntu-18.04', 'windows-latest', 'macos-latest']
6464
machines: [1, 2]
6565
runs-on: ${{ matrix.os }}
6666
steps:
@@ -70,7 +70,7 @@ jobs:
7070
# because of "record" and "parallel" parameters
7171
# these containers will load balance all found tests among themselves
7272
- name: run tests
73-
uses: cypress-io/github-action@v1
73+
uses: cypress-io/github-action@v2
7474
timeout-minutes: 10
7575
with:
7676
record: true

0 commit comments

Comments
 (0)