Skip to content

Commit 116d7d6

Browse files
authored
ci: fix retry test:browser settings (#356)
ci: fix test workflow
1 parent 1d64b34 commit 116d7d6

1 file changed

Lines changed: 24 additions & 12 deletions

File tree

.github/workflows/test.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ on:
77
branches-ignore:
88
- 'develop'
99
- 'develop*'
10-
paths-ignore:
11-
- '**.md'
12-
- '**.txt'
13-
- 'agents/**'
14-
- 'docs/**'
15-
- 'documents/**'
16-
- '.gitignore'
17-
- '.cspell.config.yaml'
18-
- '.editorconfig'
19-
- '.markdownlint-cli2.mjs'
20-
- 'LICENSE'
2110

2211
# Allows you to run this workflow manually from the Actions tab
2312
workflow_dispatch:
@@ -27,7 +16,7 @@ jobs:
2716
test:
2817
# The type of runner that the job will run on
2918
runs-on: ubuntu-latest
30-
timeout-minutes: 20
19+
timeout-minutes: 25
3120

3221
# Allow Codecov OIDC upload and minimal read access
3322
permissions:
@@ -47,6 +36,9 @@ jobs:
4736
- name: Checkout
4837
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4938

39+
- name: Fetch main
40+
run: git fetch origin main # To allow check-should-run-type-checks to get the diff from main
41+
5042
- name: Install pnpm
5143
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
5244

@@ -60,6 +52,16 @@ jobs:
6052
- name: Install dependencies
6153
run: pnpm install --frozen-lockfile
6254

55+
# NOTE: To include this workflow in the branch protection rule status check,
56+
# skip each step instead of skipping the entire workflow with paths-ignore.
57+
- name: Check diff
58+
id: check_diff_type
59+
run: pnpm exec check-should-run-type-checks
60+
61+
- name: Exit if no relevant changes
62+
if: steps.check_diff_type.outputs.should_run != 'true'
63+
run: exit 1
64+
6365
- name: Build src
6466
run: pnpm run build:min
6567

@@ -68,8 +70,18 @@ jobs:
6870
run: pnpm exec playwright install chromium
6971

7072
- name: Run "${{ matrix.command }}"
73+
if: matrix.command != 'test:browser'
7174
run: pnpm run ${{ matrix.command }}
7275

76+
# Source - https://stackoverflow.com/a/71583518
77+
- name: Run 'test:browser' with retry
78+
if: matrix.command == 'test:browser'
79+
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
80+
with:
81+
timeout_minutes: 10
82+
max_attempts: 2
83+
command: pnpm run ${{ matrix.command }}
84+
7385
- name: Upload coverage reports to Codecov
7486
if: matrix.command == 'test:cov'
7587
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0

0 commit comments

Comments
 (0)