-
Notifications
You must be signed in to change notification settings - Fork 364
133 lines (130 loc) · 4.12 KB
/
Copy pathjs-css-lint-test.yml
File metadata and controls
133 lines (130 loc) · 4.12 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Code Linting and JS Tests
on:
push:
branches:
- develop
- main
# Only run if CSS/JS/MD-related files changed.
paths:
- '.github/workflows/js-css-lint-test.yml'
- '**.js'
- '**.ts'
- '**.tsx'
- '**.json'
- '**.scss'
- '.eslint*'
- '.nvmrc'
- '.stylelint*'
- '**/package.json'
- 'package-lock.json'
- '!feature-flags.json'
- '!composer.json'
pull_request:
branches:
- develop
- main
- 'feature/**'
# Only run if CSS/JS/MD-related files changed.
paths:
- '.github/workflows/js-css-lint-test.yml'
- '**.js'
- '**.ts'
- '**.tsx'
- '**.json'
- '**.scss'
- '.eslint*'
- '.nvmrc'
- '.stylelint*'
- '**/package.json'
- 'package-lock.json'
- '!feature-flags.json'
- '!composer.json'
types:
- opened
- reopened
- synchronize
concurrency:
group: js-css-lint-test-${{ github.ref }}
cancel-in-progress: true
jobs:
css-lint:
name: CSS Lint
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
- name: npm install
run: npm ci -w assets --include-workspace-root
- name: CSS Lint
run: npm run lint:css
js-lint:
name: JS Lint
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
- name: npm install
run: npm ci --workspaces --include-workspace-root
- name: JS Lint
run: npm run lint:js
typecheck:
name: Type check
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
- name: npm install
run: npm ci -w assets -w storybook -w tests/js -w tests/e2e --include-workspace-root
- name: Type check
run: npm run typecheck
js-test:
name: JS Tests
runs-on: ubuntu-latest
timeout-minutes: 20
env:
JEST_RESULTS_FILE: jest-results.json
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
- name: npm install
run: npm ci -w assets -w storybook -w tests/js --include-workspace-root
- name: Jest Tests
id: test-js
run: npm run test:js -- -- --json --outputFile=../../${{ env.JEST_RESULTS_FILE }}
continue-on-error: true
- name: Check for catastrophic suite failures
id: check-catastrophic
run: bash tests/js/bin/check-catastrophic-jest-failures.sh "${{ env.JEST_RESULTS_FILE }}"
- name: Jest Tests (Retry Failures 1)
id: test-js-retry-1
run: npm run test:js -- -- --onlyFailures
if: steps.test-js.outcome == 'failure'
continue-on-error: true
- name: Jest Tests (Retry Failures 2)
id: test-js-retry-2
run: npm run test:js -- -- --onlyFailures
if: steps.test-js-retry-1.outcome == 'failure'
continue-on-error: true
- name: Jest Tests (Retry Failures 3)
run: npm run test:js -- -- --onlyFailures
if: steps.test-js-retry-2.outcome == 'failure'
- name: Clean up Jest results file
run: |
if [ -f ${{ env.JEST_RESULTS_FILE }} ]; then
rm -f ${{ env.JEST_RESULTS_FILE }}
fi