Skip to content

Commit 41bd6af

Browse files
authored
test: harmonize example custom-ci-build-id to use module API only (#1454)
1 parent 2a426e4 commit 41bd6af

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

.github/workflows/example-custom-ci-build-id.yml

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@ name: example-custom-ci-build-id
1313
# In that case it is important to make sure this build id
1414
# is generated _again_ on workflow re-run. This example
1515
# 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.
2317

2418
on:
2519
push:
@@ -60,14 +54,14 @@ jobs:
6054
outputs:
6155
uuid: ${{ steps.uuid.outputs.value }}
6256
steps:
63-
- name: Generate unique ID 💎
57+
- name: Generate unique ID
6458
id: uuid
6559
# take the current commit + timestamp together
6660
# the typical value would be something like
6761
# "sha-5d3fe...35d3-time-1620841214"
6862
run: echo "value=sha-$GITHUB_SHA-time-$(date +"%s")" >> $GITHUB_OUTPUT
6963

70-
- name: Print unique ID 🖨`
64+
- name: Print unique ID
7165
run: echo "generated id ${{ steps.uuid.outputs.value }}"
7266

7367
# let's run a small subset of the tests
@@ -76,13 +70,13 @@ jobs:
7670
needs: [prepare]
7771
runs-on: ubuntu-24.04
7872
steps:
79-
- name: Checkout 🛎
73+
- name: Checkout
8074
uses: actions/checkout@v4
8175

82-
- name: Print custom build id 🖨
76+
- name: Print custom build id
8377
run: echo "Custom build id is ${{ needs.prepare.outputs.uuid }}"
8478

85-
- name: Smoke tests using custom build id 🧪
79+
- name: Smoke tests using custom build id
8680
uses: ./
8781
with:
8882
# run just some specs in this group
@@ -104,22 +98,21 @@ jobs:
10498
strategy:
10599
fail-fast: false
106100
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]
109103
steps:
110-
- name: Checkout 🛎
104+
- name: Checkout
111105
uses: actions/checkout@v4
112106

113-
- name: Print custom build id 🖨
107+
- name: Print custom build id
114108
run: echo "Custom build id is ${{ needs.prepare.outputs.uuid }}"
115109

116-
- name: All tests using custom build id 🧪
110+
- name: All tests using custom build id
117111
uses: ./
118112
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
125118
working-directory: examples/recording

0 commit comments

Comments
 (0)