-
Notifications
You must be signed in to change notification settings - Fork 677
43 lines (42 loc) · 1.27 KB
/
test.yml
File metadata and controls
43 lines (42 loc) · 1.27 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
name: test
on:
workflow_call:
inputs:
node-version:
type: string
required: false
default: '22.x'
runs-on:
type: string
required: false
default: 'ubuntu-latest'
no-lockfile:
type: string
required: false
default: 'false'
jobs:
test:
name: "Tests [Node.js ${{ inputs.node-version }}, ${{ inputs.runs-on }}, ${{ inputs.no-lockfile == 'false' && 'Using yarn.lock' || 'Ignoring yarn.lock' }}]"
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/yarn-install
with:
node-version: ${{ inputs.node-version }}
no-lockfile: ${{ inputs.no-lockfile }}
- name: Run Jest Tests
env:
NIGHTLY_TESTS_NO_LOCKFILE: ${{ inputs.no-lockfile }}
shell: bash
run: |
max_attempts=3
attempt=1
until yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit --rootdir='./'; do
if [ $attempt -ge $max_attempts ]; then
echo "Tests failed after $max_attempts attempts"
exit 1
fi
echo "Attempt $attempt failed, retrying..."
attempt=$((attempt + 1))
sleep 5
done