-
-
Notifications
You must be signed in to change notification settings - Fork 934
94 lines (75 loc) · 2.18 KB
/
testing.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
name: Testing
on:
push:
branches:
- main
pull_request:
merge_group:
env:
FORCE_COLOR: 2
jobs:
lint:
uses: stylelint/.github/.github/workflows/lint.yml@main
test:
uses: stylelint/.github/.github/workflows/test.yml@main
with:
node-version: '["18", "20", "22"]'
os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
exclude: '[{"node-version": "20", "os": "ubuntu-latest"}]' # for coverage
test-coverage:
name: Test on Node.js 20 and ubuntu-latest with coverage
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- name: Install latest npm
run: npm install --global npm
- name: Install dependencies
run: npm ci
- name: Test with coverage
run: npm run test-coverage
env:
# https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
NODE_OPTIONS: '--max-old-space-size=4096'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./.coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: npm
- name: Install latest npm
run: npm install --global npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Check built files
run: npm run build-check
spellcheck:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install codespell
run: pip install codespell
- name: Spellcheck
# Ignore a CI failure because there are false positives.
run: codespell || echo 'Fix misspells via "codespell" on your console, or ignore false positives.'