-
-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (43 loc) · 1.26 KB
/
cypress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: cypress
on: [push, pull_request]
concurrency:
group: ${{ github.workflow_ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
cypress:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [0, 1, 2]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Split specs
id: specs
run: |
SPECS=specs
find cypress/e2e -type f -name '*.feature' > $SPECS
SPECS_COUNT=$(wc -l < $SPECS)
LINES=$(( ($SPECS_COUNT + 1) / ${{ strategy.job-total }} ))
split -d -l $LINES $SPECS spec
echo "SPECS<<EOF" >> $GITHUB_OUTPUT
cat spec0${{ matrix.shard }} >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Cypress run
uses: cypress-io/github-action@v6
with:
browser: chrome
spec: |
${{ steps.specs.outputs.SPECS }}
- name: Record failed screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Record videos
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
path: cypress/videos