|
9 | 9 | pull_request: |
10 | 10 | branches: [devel] |
11 | 11 |
|
| 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 | + |
12 | 18 | 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 | + |
13 | 41 | cypress: |
14 | 42 | 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 |
16 | 45 | runs-on: ubuntu-latest |
17 | 46 | 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] |
21 | 53 | steps: |
22 | | - - uses: actions/checkout@v4 |
| 54 | + - uses: actions/checkout@v7 |
23 | 55 | name: Checkout |
24 | 56 | - name: Setup node |
25 | | - uses: actions/setup-node@v4 |
| 57 | + uses: actions/setup-node@v6 |
26 | 58 | with: |
27 | 59 | node-version-file: '.nvmrc' |
28 | 60 | cache: 'yarn' |
29 | 61 | - name: Install dependencies |
30 | 62 | run: yarn install |
| 63 | + - name: Download build artifact |
| 64 | + uses: actions/download-artifact@v8 |
| 65 | + with: |
| 66 | + name: build |
| 67 | + path: build |
31 | 68 | - 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 }} |
33 | 73 | 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 |
37 | 76 | wait-on: "http://localhost:3000" |
38 | 77 | config: baseUrl=http://localhost:3000 |
39 | 78 | browser: chrome |
40 | 79 | # store any screenshots of the failing tests as artifacts |
41 | | - - uses: actions/upload-artifact@v4 |
| 80 | + - uses: actions/upload-artifact@v7 |
42 | 81 | if: failure() |
43 | 82 | with: |
44 | 83 | overwrite: true |
45 | | - name: cypress-screenshots |
| 84 | + name: cypress-screenshots-${{ matrix.containers }} |
46 | 85 | path: cypress/screenshots |
47 | 86 |
|
48 | 87 | jest: |
49 | 88 | if: github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip tests]') |
50 | 89 | name: Run unit tests |
51 | 90 | runs-on: ubuntu-latest |
52 | 91 | steps: |
53 | | - - uses: actions/checkout@v4 |
| 92 | + - uses: actions/checkout@v7 |
54 | 93 | - name: Setup node |
55 | | - uses: actions/setup-node@v4 |
| 94 | + uses: actions/setup-node@v6 |
56 | 95 | with: |
57 | 96 | node-version-file: '.nvmrc' |
58 | 97 | cache: 'yarn' |
|
66 | 105 | name: Check format with prettier |
67 | 106 | runs-on: ubuntu-latest |
68 | 107 | steps: |
69 | | - - uses: actions/checkout@v4 |
| 108 | + - uses: actions/checkout@v7 |
70 | 109 | - name: Setup node |
71 | | - uses: actions/setup-node@v4 |
| 110 | + uses: actions/setup-node@v6 |
72 | 111 | with: |
73 | 112 | node-version-file: '.nvmrc' |
74 | 113 | cache: 'yarn' |
|
82 | 121 | name: Lint with ESLint |
83 | 122 | runs-on: ubuntu-latest |
84 | 123 | steps: |
85 | | - - uses: actions/checkout@v4 |
| 124 | + - uses: actions/checkout@v7 |
86 | 125 | - name: Setup node |
87 | | - uses: actions/setup-node@v4 |
| 126 | + uses: actions/setup-node@v6 |
88 | 127 | with: |
89 | 128 | node-version-file: '.nvmrc' |
90 | 129 | cache: 'yarn' |
|
0 commit comments