-
Notifications
You must be signed in to change notification settings - Fork 673
98 lines (85 loc) · 2.84 KB
/
Copy pathweb-argos-e2e.yml
File metadata and controls
98 lines (85 loc) · 2.84 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Web Argos E2E
on:
workflow_dispatch:
inputs:
reference_branch:
description: 'Argos baseline branch (default: dev)'
required: false
type: string
reference_commit:
description: 'Argos baseline commit SHA (full 40-char hex)'
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
e2e:
env:
VISUAL_REGRESSION_BUILD: 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
name: Cypress Visual tests (Argos)
permissions:
contents: read
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6.0.0
with:
fetch-depth: 0
# Deterministic spec sharding: each container always runs the same specs,
# even on retry, so Argos receives consistent screenshots per shard.
- name: Compute spec shard
id: specs
shell: bash
run: |
ALL_SPECS=($(ls apps/web/cypress/e2e/visual/*.cy.js | sort))
TOTAL=${#ALL_SPECS[@]}
SHARD_INDEX=$(( ${{ matrix.containers }} - 1 ))
SHARD_TOTAL=5
SHARD_SPECS=()
for i in "${!ALL_SPECS[@]}"; do
if [ $(( i % SHARD_TOTAL )) -eq $SHARD_INDEX ]; then
SPEC="${ALL_SPECS[$i]#apps/web/}"
SHARD_SPECS+=("$SPEC")
fi
done
SPEC_LIST=$(IFS=,; echo "${SHARD_SPECS[*]}")
echo "specs=$SPEC_LIST" >> "$GITHUB_OUTPUT"
echo "Shard ${{ matrix.containers }}: ${#SHARD_SPECS[@]} specs out of $TOTAL total"
- uses: ./.github/actions/cypress
with:
secrets: ${{ toJSON(secrets) }}
spec: ${{ steps.specs.outputs.specs }}
group: 'Argos E2E'
tag: 'argos-e2e'
container-index: ${{ matrix.containers }}
parallel: 'false'
record: 'false'
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN_E2E }}
ARGOS_REFERENCE_BRANCH: ${{ inputs.reference_branch || 'dev' }}
ARGOS_REFERENCE_COMMIT: ${{ inputs.reference_commit || '' }}
ARGOS_PARALLEL: 'true'
ARGOS_PARALLEL_TOTAL: '-1'
ARGOS_PARALLEL_INDEX: ${{ matrix.containers }}
ARGOS_PARALLEL_NONCE: ${{ github.run_id }}
finalize-argos:
needs: [e2e]
if: '!cancelled()'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6.0.0
- uses: ./.github/actions/yarn
- name: Finalize Argos build
run: npx @argos-ci/cli finalize
working-directory: apps/web
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN_E2E }}
ARGOS_PARALLEL_NONCE: ${{ github.run_id }}