-
Notifications
You must be signed in to change notification settings - Fork 6
73 lines (61 loc) · 1.71 KB
/
Copy pathtest.yml
File metadata and controls
73 lines (61 loc) · 1.71 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Check Node.js version
run: |
echo "Node.js version: $(node --version)"
echo "npm version: $(npm --version)"
echo "Node.js major version: $(node --version | cut -d. -f1 | tr -d v)"
- name: Install dependencies
run: npm ci
- name: Clean and build project
run: |
# Clean any existing build artifacts
rm -rf dist/
# Build the project
npm run build
# Verify build artifacts exist
ls -la dist/
- name: Run tests
run: |
# Run tests with retry mechanism for better stability
for i in {1..3}; do
echo "Test attempt $i/3"
if npm test; then
echo "Tests passed on attempt $i"
break
elif [ $i -eq 3 ]; then
echo "Tests failed after 3 attempts"
exit 1
else
echo "Test attempt $i failed, retrying..."
sleep 5
fi
done
env:
# Set longer timeout for tests
VITEST_TIMEOUT: 60000
# Uncomment the next line to skip hook tests
SKIP_HOOK_TESTS: true
- name: Run linting
run: npm run lint
- name: Check formatting
run: npx prettier --check src/ test/
- name: Test development mode compatibility
run: npm run dev -- --version