@@ -13,13 +13,7 @@ name: example-custom-ci-build-id
13
13
# In that case it is important to make sure this build id
14
14
# is generated _again_ on workflow re-run. This example
15
15
# shows how to create a unique ID then pass it to
16
- # multiple testing jobs running in parallel
17
- # based on the recipe written in
18
- # https://medium.com/attest-r-and-d/adding-a-unique-github-build-identifier-7aa2e83cadca
19
- # The use of set-output is however deprecated by GitHub since the above blog
20
- # was written in 2019 so this is replaced by GitHub Environment files, see
21
- # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
22
- #
16
+ # multiple testing jobs running in parallel.
23
17
24
18
on :
25
19
push :
@@ -60,14 +54,14 @@ jobs:
60
54
outputs :
61
55
uuid : ${{ steps.uuid.outputs.value }}
62
56
steps :
63
- - name : Generate unique ID 💎
57
+ - name : Generate unique ID
64
58
id : uuid
65
59
# take the current commit + timestamp together
66
60
# the typical value would be something like
67
61
# "sha-5d3fe...35d3-time-1620841214"
68
62
run : echo "value=sha-$GITHUB_SHA-time-$(date +"%s")" >> $GITHUB_OUTPUT
69
63
70
- - name : Print unique ID 🖨`
64
+ - name : Print unique ID
71
65
run : echo "generated id ${{ steps.uuid.outputs.value }}"
72
66
73
67
# let's run a small subset of the tests
@@ -76,13 +70,13 @@ jobs:
76
70
needs : [prepare]
77
71
runs-on : ubuntu-24.04
78
72
steps :
79
- - name : Checkout 🛎
73
+ - name : Checkout
80
74
uses : actions/checkout@v4
81
75
82
- - name : Print custom build id 🖨
76
+ - name : Print custom build id
83
77
run : echo "Custom build id is ${{ needs.prepare.outputs.uuid }}"
84
78
85
- - name : Smoke tests using custom build id 🧪
79
+ - name : Smoke tests using custom build id
86
80
uses : ./
87
81
with :
88
82
# run just some specs in this group
@@ -104,22 +98,21 @@ jobs:
104
98
strategy :
105
99
fail-fast : false
106
100
matrix :
107
- # run 3 copies of the current job in parallel
108
- containers : [1, 2, 3 ]
101
+ # run 2 copies of the current job in parallel
102
+ containers : [1, 2]
109
103
steps :
110
- - name : Checkout 🛎
104
+ - name : Checkout
111
105
uses : actions/checkout@v4
112
106
113
- - name : Print custom build id 🖨
107
+ - name : Print custom build id
114
108
run : echo "Custom build id is ${{ needs.prepare.outputs.uuid }}"
115
109
116
- - name : All tests using custom build id 🧪
110
+ - name : All tests using custom build id
117
111
uses : ./
118
112
with :
119
- # we can pass the build id using CLI argument
120
- # since we are using a custom command
121
- command : |
122
- npx cypress run --record --parallel \
123
- --ci-build-id ${{ needs.prepare.outputs.uuid }} \
124
- --group "2 - all tests"
113
+ record : true
114
+ parallel : true
115
+ group : ' 2 - all tests'
116
+ ci-build-id : ${{ needs.prepare.outputs.uuid }}
117
+ publish-summary : false # view consolidated test summary on Cypress Cloud
125
118
working-directory : examples/recording
0 commit comments