forked from maplibre/maplibre-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (161 loc) · 4.55 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
163
164
165
166
167
168
169
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@v3
with:
node-version: lts/*
- run: npm ci
- run: npm run lint
if: success() || failure()
- run: npm run lint-css
if: success() || failure()
- run: npm run generate-typings
if: success() || failure()
- run: npm run typecheck
if: success() || failure()
- run: npm run generate-docs
- run: docker run --rm -v ${PWD}:/docs squidfunk/mkdocs-material build
unit-tests:
name: Unit tests and Coverage
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Start display server
if: runner.os == 'Linux'
run: nohup Xvfb &
echo "DISPLAY=:0" >> $GITHUB_ENV
- run: npm ci
- run: npm run jest-ci -- --coverage --coverageReporters json text html-spa --selectProjects unit
- name: Upload unit test coverage
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: unit-test-coverage
path: ${{ github.workspace }}/coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ${{ github.workspace }}/coverage/coverage-final.json
verbose: 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@v3
with:
node-version: lts/*
- run: npm ci
- run: npm run build-dist
- uses: actions/upload-artifact@v3
if: success()
with:
name: build-dist
path: dist/maplibre-gl.js
- run: npm run test-integration
if: success() || failure()
render-tests-ubuntu:
name: Render tests
env:
SPLIT_COUNT: 2
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
split: [0, 1]
runs-on: ${{ matrix.os }}
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: install CJK fonts for local ideographs render tests
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-prod
- run: npm run test-render
env:
CURRENT_SPLIT_INDEX: ${{ matrix.split }}
if: success() || failure()
- name: Upload render test failure
if: failure()
uses: actions/upload-artifact@v3
with:
name: render-test-report-${{ matrix.os }}-${{ matrix.split }}
path: ${{ github.workspace }}/test/integration/render/results.html
render-tests-windows:
name: Render tests
env:
SPLIT_COUNT: 3
strategy:
fail-fast: false
matrix:
os: [windows-latest]
split: [0, 1, 2]
runs-on: ${{ matrix.os }}
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: lts/*
- run: npm ci
- name: Start display server
if: runner.os == 'Linux'
run: nohup Xvfb &
echo "DISPLAY=:0" >> $GITHUB_ENV
- run: npm run build-prod
- run: npm run test-render
env:
CURRENT_SPLIT_INDEX: ${{ matrix.split }}
if: success() || failure()
- name: Upload render test failure
if: failure()
uses: actions/upload-artifact@v3
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@v3
with:
node-version: lts/*
- run: npm ci
- run: npm run build-dist
- run: npm run test-build
if: success() || failure()