forked from bestiejs/benchmark.js
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (135 loc) · 4.98 KB
/
nodejs.yml
File metadata and controls
136 lines (135 loc) · 4.98 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
134
135
136
# This workflow will do a clean installation of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
paths:
- benchmark.js
- package.json
- package-lock.json
- .github/workflows/*.yml
- .c8rc.coveralls.json
- test/test.js
- test/index.html
- playwright.js
- rolldown.config.js
pull_request:
branches: [main]
paths:
- benchmark.js
- package.json
- package-lock.json
- test/test.js
- test/index.html
jobs:
fail-early:
runs-on: ubuntu-latest
strategy:
matrix:
node_version:
- 20
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node_version }}
cache: 'npm'
- run: npm ci
- run: node ./dump-version.js
- run: ./node_modules/.bin/rolldown -c ./rolldown.config.js
- run: node ./test/test.js
basic-checks:
runs-on: ubuntu-latest
needs: fail-early
strategy:
matrix:
node_version:
- 22
- 23
- 24
- 25
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node_version }}
cache: 'npm'
- run: npm ci
- run: node ./dump-version.js
- run: ./node_modules/.bin/rolldown -c ./rolldown.config.js
- run: node ./test/test.js
playwright:
name: Playwright
runs-on: ubuntu-latest
needs: fail-early
strategy:
matrix:
browser:
- firefox
- webkit
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20 (${{ matrix.browser }})
uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: node ./dump-version.js
- run: ./node_modules/.bin/rolldown -c ./rolldown.config.js
- uses: hoverkraft-tech/compose-action@05da55b2bb8a5a759d1c4732095044bd9018c050
with:
services: tests
cwd: ./.devcontainer/
compose-file: ./docker-compose.yml
- name: http check
id: http-check
uses: fjogeleit/http-request-action@v1
with:
url: "http://localhost:8003"
method: GET
- run: ./node_modules/.bin/playwright install --with-deps --only-shell ${{ matrix.browser }}
- run: node ./playwright.js http://localhost:8003 --browser=${{ matrix.browser }}
coverage:
name: Coverage
runs-on: ubuntu-latest
needs: fail-early
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: node ./dump-version.js
- run: ./node_modules/.bin/rolldown -c ./rolldown.config.js
- name: Node Coverage (with microtime)
run: ./node_modules/.bin/c8 -c ./.c8rc.node.json node ./test/test.js
- run: npm ci --omit=optional
- name: Node Coverage (without microtime)
run: ./node_modules/.bin/c8 -c ./.c8rc.node.json node ./test/test.js
- uses: hoverkraft-tech/compose-action@05da55b2bb8a5a759d1c4732095044bd9018c050
with:
services: tests
cwd: ./.devcontainer/
compose-file: ./docker-compose.yml
- name: http check
id: http-check
uses: fjogeleit/http-request-action@v1
with:
url: "http://localhost:8003"
method: GET
- run: ./node_modules/.bin/playwright install --with-deps --only-shell chromium
- name: Browser Coverage
run: node ./playwright.js http://localhost:8003 --browser=chromium
- run: cp -r ./coverage/*/tmp/*.json ./coverage/tmp
- run: ls -R ./coverage/tmp/
- name: Merge Coverage
run: ./node_modules/.bin/c8 -c ./.c8rc.coveralls.json report
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.2.3
with:
file: './coverage/lcov.info'