|
7 | 7 | branches-ignore: |
8 | 8 | - 'develop' |
9 | 9 | - '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' |
21 | 10 |
|
22 | 11 | # Allows you to run this workflow manually from the Actions tab |
23 | 12 | workflow_dispatch: |
|
27 | 16 | test: |
28 | 17 | # The type of runner that the job will run on |
29 | 18 | runs-on: ubuntu-latest |
30 | | - timeout-minutes: 20 |
| 19 | + timeout-minutes: 25 |
31 | 20 |
|
32 | 21 | # Allow Codecov OIDC upload and minimal read access |
33 | 22 | permissions: |
|
47 | 36 | - name: Checkout |
48 | 37 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
49 | 38 |
|
| 39 | + - name: Fetch main |
| 40 | + run: git fetch origin main # To allow check-should-run-type-checks to get the diff from main |
| 41 | + |
50 | 42 | - name: Install pnpm |
51 | 43 | uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 |
52 | 44 |
|
|
60 | 52 | - name: Install dependencies |
61 | 53 | run: pnpm install --frozen-lockfile |
62 | 54 |
|
| 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 | + |
63 | 65 | - name: Build src |
64 | 66 | run: pnpm run build:min |
65 | 67 |
|
|
68 | 70 | run: pnpm exec playwright install chromium |
69 | 71 |
|
70 | 72 | - name: Run "${{ matrix.command }}" |
| 73 | + if: matrix.command != 'test:browser' |
71 | 74 | run: pnpm run ${{ matrix.command }} |
72 | 75 |
|
| 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 | + |
73 | 85 | - name: Upload coverage reports to Codecov |
74 | 86 | if: matrix.command == 'test:cov' |
75 | 87 | uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 |
|
0 commit comments