Skip to content

Commit 126af18

Browse files
committed
update build rules
1 parent 73aeba6 commit 126af18

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Use Node.js 😂
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: 18
19+
node-version: 20
2020

2121
- name: Install and Build 🔧
2222
run: |

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ on:
33
push:
44
branches:
55
- main
6+
- dev
7+
- test
68
pull_request:
79
jobs:
810
test:
9-
runs-on: ubuntu-latest
11+
runs-on: macos-latest
1012
steps:
1113
- name: Checkout 🍔🍟🥤
1214
uses: actions/checkout@v4
@@ -16,7 +18,7 @@ jobs:
1618
- name: Use Node.js 😂
1719
uses: actions/setup-node@v4
1820
with:
19-
node-version: 18
21+
node-version: 20
2022

2123
- name: Test 🧪
2224
run: |

test/puppeteer.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
#!/usr/bin/env node
22

3+
import process from 'node:process';
34
import puppeteer from 'puppeteer';
4-
import path from 'path';
5-
import fs from 'fs';
5+
import path from 'node:path';
6+
import fs from 'node:fs';
67
import express from 'express';
7-
import url from 'url';
8+
import url from 'node:url';
89
const app = express();
910
const port = 3000;
1011
const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); // eslint-disable-line
1112

1213
app.use(express.static(path.dirname(__dirname)));
13-
const server = app.listen(port, () => {
14+
const server = app.listen(port, (err) => {
15+
if (err) {
16+
console.error('Error starting server:', err);
17+
// eslint-disable-next-line no-process-exit
18+
process.exit(1);
19+
}
1420
console.log(`Example app listening on port ${port}!`);
1521
test(port);
1622
});
@@ -39,6 +45,7 @@ function getExamples(port) {
3945
async function test(port) {
4046
const browser = await puppeteer.launch({
4147
headless: "new",
48+
protocolTimeout: 4 * 60 * 1000, // 4 mins
4249
args: [
4350
//'--enable-unsafe-webgpu',
4451
//'--enable-webgpu-developer-features',

0 commit comments

Comments
 (0)