-
-
Notifications
You must be signed in to change notification settings - Fork 716
162 lines (153 loc) · 4.52 KB
/
test-all.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
checks: write
pull-requests: write
contents: write
jobs:
code-hygiene:
name: Code Hygiene
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run lint
if: '!cancelled()'
- run: npm run lint-css
if: '!cancelled()'
- run: npm run generate-typings
if: '!cancelled()'
- run: npm run typecheck
if: '!cancelled()'
- run: npm run generate-docs
- name: Build docs using docker and mkdocs-material
run: |
rm docs/README.md
rm -rf docs/API/_media
docker run --rm -v ${PWD}:/docs squidfunk/mkdocs-material build --strict
- name: Check spelling
# This need to run after the docs are built
run: npm run spellcheck
unit-tests:
name: Unit tests and Coverage
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Start display server
run: nohup Xvfb &
echo "DISPLAY=:0" >> $GITHUB_ENV
- run: npm ci
- run: npm run test-unit-ci
- name: Upload test results to Codecov
if: '!cancelled()'
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
files: ${{ github.workspace }}/coverage/jest/codecov.json
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
integration-tests:
name: Integration tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run build-dist
- uses: actions/upload-artifact@v4
if: '!cancelled()'
with:
name: build-dist-${{ matrix.os }}
path: dist/maplibre-gl.js
- run: npm run test-integration-ci
- name: Upload coverage reports to Codecov
if: '!cancelled()'
uses: codecov/codecov-action@v4
with:
files: ${{ github.workspace }}/coverage/jest/codecov.json
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
render-tests:
name: Render tests
env:
SPLIT_COUNT: 3
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
split: [0, 1, 2]
runs-on: ${{ matrix.os }}
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: install CJK fonts for local ideographs render tests
if: runner.os == 'Linux'
run: sudo apt install fonts-noto-cjk
- run: npm ci
- name: Start display server
if: runner.os == 'Linux'
run: nohup Xvfb &
echo "DISPLAY=:0" >> $GITHUB_ENV
- run: npm run build-dist
- name: Run Render tests
run: npm run test-render
env:
CURRENT_SPLIT_INDEX: ${{ matrix.split }}
- name: Upload coverage reports to Codecov
if: '!cancelled()'
uses: codecov/codecov-action@v4
with:
files: ${{ github.workspace }}/coverage/render/codecov.json
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
- name: Upload test results to Codecov
if: '!cancelled()'
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload render test failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: render-test-report-${{ matrix.os }}-${{ matrix.split }}
path: ${{ github.workspace }}/test/integration/render/results.html
build-tests:
name: Build tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run build-dist
- run: npm run test-build-ci