-
-
Notifications
You must be signed in to change notification settings - Fork 189
78 lines (65 loc) · 2.24 KB
/
Copy pathfrontend.yml
File metadata and controls
78 lines (65 loc) · 2.24 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
# To upgrade pinned actions: Use https://github.com/mheap/pin-github-action
name: CI - Frontend
env:
OS: &os ubuntu-24.04
TIMEOUT: &timeout 5
SHOULD_RUN: &should-run >-
github.event_name == 'workflow_dispatch' ||
github.event_name == 'workflow_call' ||
github.repository == 'getkirby/kirby' ||
github.repository_owner != 'getkirby'
on:
# only the long-lived base branches run on push, so that their caches
# are seeded for the pull requests targeting them; feature/fix branches
# are covered by the pull_request event instead, which can restore caches
# from its base branch and keeps the same commit from running twice
push:
branches:
- "main"
- "develop-patch"
- "develop-minor"
- "v*/develop"
paths: &frontend-paths
- ".github/actions/setup-npm/**"
- ".github/workflows/frontend.yml"
- "panel/**"
- "!panel/scripts/**"
pull_request:
paths: *frontend-paths
workflow_call:
workflow_dispatch:
concurrency:
group: frontend-${{ github.ref }}
cancel-in-progress: true
jobs:
# ===================== Tests & Style =====================
tests:
name: "Tests & Style"
if: *should-run
runs-on: *os
timeout-minutes: *timeout
defaults:
run:
working-directory: panel
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Setup Node/npm
uses: ./.github/actions/setup-npm
- name: Run JavaScript unit tests with coverage
run: npm run test:coverage
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
with:
# for better reliability if the GitHub API is down
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: panel/tests/coverage/lcov.info
disable_search: true
flags: frontend
- name: Check for TypeScript type errors
run: npm run test:types
- name: "ESLint: JavaScript coding style violations"
run: npm run lint -- --max-warnings 0 --format stylish --no-fix
- name: "Prettier: JavaScript coding style violations"
run: npm run format -- --check