-
Notifications
You must be signed in to change notification settings - Fork 296
85 lines (71 loc) · 2.18 KB
/
eval-hub-frontend-tests.yml
File metadata and controls
85 lines (71 loc) · 2.18 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
74
75
76
77
78
79
80
81
82
83
84
85
name: Test / EvalHub Frontend Tests
on:
push:
paths:
- 'packages/eval-hub/**'
- '!LICENSE*'
- '!DOCKERFILE*'
- '!**.gitignore'
- '!**.md'
pull_request:
paths:
- 'packages/eval-hub/**'
- '!LICENSE*'
- '!DOCKERFILE*'
- '!**.gitignore'
- '!**.md'
env:
NODE_VERSION: 22
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: |
**/node_modules
~/.npm
~/.cache/Cypress
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-npm-${{ hashFiles('package-lock.json', 'packages/eval-hub/frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ env.NODE_VERSION }}-npm-
- name: Install root level dependencies
run: npm install
- name: Install dependencies
working-directory: packages/eval-hub/frontend
run: npm install
- name: Lint
working-directory: packages/eval-hub/frontend
run: npm run test:lint
- name: Type check
working-directory: packages/eval-hub/frontend
run: npm run test:type-check
- name: Unit tests (Jest)
working-directory: packages/eval-hub/frontend
run: npm run test:unit
- name: Cypress mock tests
working-directory: packages/eval-hub/frontend
run: npm run test:cypress-ci
- name: Run clean
working-directory: packages/eval-hub/frontend
run: npm run build:clean
- name: Run build
working-directory: packages/eval-hub/frontend
run: npm run build
- name: Check if there are uncommitted file changes
working-directory: packages/eval-hub/frontend
run: |
clean=$(git status --porcelain)
if [[ -z "$clean" ]]; then
echo "Empty git status --porcelain: $clean"
else
echo "Uncommitted file changes detected: $clean"
git diff
exit 1
fi