-
Notifications
You must be signed in to change notification settings - Fork 1.2k
89 lines (72 loc) · 2.42 KB
/
Copy pathfrontend-tests.yml
File metadata and controls
89 lines (72 loc) · 2.42 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
86
87
88
89
name: Frontend
on:
pull_request:
paths-ignore:
- "**.md"
- "**.py"
- "**.txt"
- "**.csv"
- "**.po"
- "**.pot"
- ".github/workflows/server-tests.yml"
- ".github/workflows/builds.yml"
schedule:
# Run every day at midnight UTC / 5:30 IST
- cron: "0 0 * * *"
workflow_dispatch:
concurrency:
group: frontend-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: yarn
cache-dependency-path: frontend/yarn.lock
- name: Install dependencies
run: cd frontend && yarn install --frozen-lockfile
- name: ESLint
run: cd frontend && npx eslint src --ext .js,.ts,.vue
- name: Oxlint
run: cd frontend && npx oxlint src
test:
name: Unit Tests & Coverage
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: yarn
cache-dependency-path: frontend/yarn.lock
- name: Run frontend tests
uses: ./.github/actions/frontend-tests
with:
node-version: "24"
enable-coverage: "true"
- name: Upload coverage artifact
if: github.base_ref == 'develop' || github.ref_name == 'develop'
uses: ./.github/actions/upload-coverage
with:
artifact-name: coverage-frontend
coverage-path: frontend/coverage/lcov.info
coverage:
name: Coverage Wrap Up
needs: test
if: github.base_ref == 'develop' || github.ref_name == 'develop'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Publish coverage to Codecov
uses: ./.github/actions/publish-codecov
with:
name: Frontend
token: ${{ secrets.CODECOV_TOKEN }}