Skip to content

Commit 7b0bf3e

Browse files
authored
Merge pull request #1208 from sanger/ci-fixes
CI Fixes
1 parent bfd2cbb commit 7b0bf3e

6 files changed

Lines changed: 998 additions & 44 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
# Steps represent a sequence of tasks that will be executed as part of the job
1515
steps:
1616
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v7
1818
name: Checkout
1919
- name: Enable Corepack
2020
run: corepack enable
2121
- name: Setup node
22-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@v6
2323
with:
2424
node-version-file: '.nvmrc'
2525
cache: 'yarn'

.github/workflows/deploy-storybook.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v7
1616
name: Checkout
1717
- name: Setup node
18-
uses: actions/setup-node@v4
18+
uses: actions/setup-node@v6
1919
with:
2020
node-version-file: '.nvmrc'
2121
cache: 'yarn'
@@ -28,7 +28,7 @@ jobs:
2828
yarn build-storybook
2929
3030
- name: Deploy storybook
31-
uses: JamesIves/github-pages-deploy-action@4.1.5
31+
uses: JamesIves/github-pages-deploy-action@v4
3232
with:
3333
branch: gh-pages
3434
folder: storybook-static

.github/workflows/test.yml

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,89 @@ on:
99
pull_request:
1010
branches: [devel]
1111

12+
# Cancel in-progress runs on the same PR when a new push arrives.
13+
# On pushes to devel, queue runs instead of cancelling so each commit gets a status.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
17+
1218
jobs:
19+
build:
20+
if: github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip tests]')
21+
name: Build app for cypress
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v7
25+
- name: Setup node
26+
uses: actions/setup-node@v6
27+
with:
28+
node-version-file: '.nvmrc'
29+
cache: 'yarn'
30+
- name: Install dependencies
31+
run: yarn --frozen-lockfile --silent
32+
- name: Build
33+
run: yarn build
34+
- name: Upload build artifact
35+
uses: actions/upload-artifact@v7
36+
with:
37+
name: build
38+
path: build
39+
retention-days: 1
40+
1341
cypress:
1442
if: github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip tests]')
15-
name: Run cypress tests
43+
name: Run cypress tests (${{ matrix.containers }}/4)
44+
needs: build
1645
runs-on: ubuntu-latest
1746
container:
18-
image: cypress/browsers:node18.12.0-chrome106-ff106
19-
20-
options: --user 1001
47+
image: cypress/browsers:22.14.0
48+
options: --user 1001 --ipc=host
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
containers: [1, 2, 3, 4]
2153
steps:
22-
- uses: actions/checkout@v4
54+
- uses: actions/checkout@v7
2355
name: Checkout
2456
- name: Setup node
25-
uses: actions/setup-node@v4
57+
uses: actions/setup-node@v6
2658
with:
2759
node-version-file: '.nvmrc'
2860
cache: 'yarn'
2961
- name: Install dependencies
3062
run: yarn install
63+
- name: Download build artifact
64+
uses: actions/download-artifact@v8
65+
with:
66+
name: build
67+
path: build
3168
- name: Cypress run
32-
uses: cypress-io/github-action@v6
69+
uses: cypress-io/github-action@v7
70+
env:
71+
SPLIT: ${{ strategy.job-total }}
72+
SPLIT_INDEX: ${{ strategy.job-index }}
3373
with:
34-
install-command: yarn --frozen-lockfile --silent
35-
build: yarn build
36-
start: npx serve -s build -p 3000
74+
install: false
75+
start: npx serve -s build -p 3000 --no-request-logging
3776
wait-on: "http://localhost:3000"
3877
config: baseUrl=http://localhost:3000
3978
browser: chrome
4079
# store any screenshots of the failing tests as artifacts
41-
- uses: actions/upload-artifact@v4
80+
- uses: actions/upload-artifact@v7
4281
if: failure()
4382
with:
4483
overwrite: true
45-
name: cypress-screenshots
84+
name: cypress-screenshots-${{ matrix.containers }}
4685
path: cypress/screenshots
4786

4887
jest:
4988
if: github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip tests]')
5089
name: Run unit tests
5190
runs-on: ubuntu-latest
5291
steps:
53-
- uses: actions/checkout@v4
92+
- uses: actions/checkout@v7
5493
- name: Setup node
55-
uses: actions/setup-node@v4
94+
uses: actions/setup-node@v6
5695
with:
5796
node-version-file: '.nvmrc'
5897
cache: 'yarn'
@@ -66,9 +105,9 @@ jobs:
66105
name: Check format with prettier
67106
runs-on: ubuntu-latest
68107
steps:
69-
- uses: actions/checkout@v4
108+
- uses: actions/checkout@v7
70109
- name: Setup node
71-
uses: actions/setup-node@v4
110+
uses: actions/setup-node@v6
72111
with:
73112
node-version-file: '.nvmrc'
74113
cache: 'yarn'
@@ -82,9 +121,9 @@ jobs:
82121
name: Lint with ESLint
83122
runs-on: ubuntu-latest
84123
steps:
85-
- uses: actions/checkout@v4
124+
- uses: actions/checkout@v7
86125
- name: Setup node
87-
uses: actions/setup-node@v4
126+
uses: actions/setup-node@v6
88127
with:
89128
node-version-file: '.nvmrc'
90129
cache: 'yarn'

cypress.config.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import { defineConfig } from 'cypress';
2+
import cypressSplit from 'cypress-split';
23

34
export default defineConfig({
45
video: false,
56
defaultCommandTimeout: 15000,
6-
retries: 2,
7+
retries: { runMode: 1, openMode: 0 },
78
numTestsKeptInMemory: 0,
89
experimentalMemoryManagement: true,
910
e2e: {
10-
// We've imported your old cypress plugins here.
11-
// You may want to clean this up later by importing these.
1211
setupNodeEvents(on, config) {
13-
return require("./cypress/plugins/index.js")(on, config);
12+
cypressSplit(on, config);
13+
require('./cypress/plugins/index.js')(on, config);
14+
return config;
1415
},
1516
baseUrl: "http://localhost:3000",
1617
testIsolation: false,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
"babel-plugin-polyfill-corejs2": "^0.4.6",
119119
"cypress": "^14.1.0",
120120
"cypress-intellij-reporter": "^0.0.7",
121+
"cypress-split": "^1.24.0",
121122
"eslint-config-prettier": "10.0.1",
122123
"fishery": "^2.2.2",
123124
"identity-obj-proxy": "^3.0.0",

0 commit comments

Comments
 (0)