-
-
Notifications
You must be signed in to change notification settings - Fork 171
117 lines (100 loc) · 3.5 KB
/
frontend.yml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# To upgrade pinned actions: Use https://github.com/mheap/pin-github-action
name: CI - Frontend
on:
push:
branches-ignore:
- "main"
- "release/**"
paths:
- ".github/workflows/frontend.yml"
- "panel/**"
- "!panel/scripts/**"
pull_request:
branches-ignore:
- "main"
- "release/**"
paths:
- ".github/workflows/frontend.yml"
- "panel/**"
- "!panel/scripts/**"
workflow_call:
workflow_dispatch:
jobs:
tests:
name: "Unit tests"
# run job only under the following conditions:
# - can be triggered manually from any repository
# - if on pull request, only run if from a fork
# (our own repo is covered by the push event)
# - if on push, only run CI automatically for the
# main getkirby/kirby repo and for forks
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository
) ||
(
github.event_name == 'push' &&
(github.repository == 'getkirby/kirby' || github.repository_owner != 'getkirby')
)
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
- name: Set up Node.js problem matchers and cache npm dependencies
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # pin@v4
with:
cache: "npm"
cache-dependency-path: panel/package-lock.json
- name: Install npm dependencies
id: finishPrepare
run: npm ci
working-directory: panel
- name: Run JavaScript unit tests
if: always() && steps.finishPrepare.outcome == 'success'
run: npm run test:unit
working-directory: panel
coding-style:
name: "Coding Style"
# run job only under the following conditions:
# - can be triggered manually from any repository
# - if on pull request, only run if from a fork
# (our own repo is covered by the push event)
# - if on push, only run CI automatically for the
# main getkirby/kirby repo and for forks
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository
) ||
(
github.event_name == 'push' &&
(github.repository == 'getkirby/kirby' || github.repository_owner != 'getkirby')
)
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
php: "8.2"
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
- name: Set up Node.js problem matchers and cache npm dependencies
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # pin@v4
with:
cache: "npm"
cache-dependency-path: panel/package-lock.json
- name: Install npm dependencies
id: finishPrepare
run: npm ci
working-directory: panel
- name: Check for JavaScript coding style violations (ESLint)
if: always() && steps.finishPrepare.outcome == 'success'
run: npm run lint -- --max-warnings 0 --format stylish --no-fix
working-directory: panel
- name: Check for JavaScript coding style violations (Prettier)
if: always() && steps.finishPrepare.outcome == 'success'
run: npm run format --check
working-directory: panel