From 6245823440b0c0a0877ae2372755cb1e051167c8 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 22 Apr 2024 13:41:08 -0700 Subject: [PATCH 1/3] add script --- .github/workflows/nodejs.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/nodejs.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..501588a --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,31 @@ +name: Node CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-20.04 + timeout-minutes: 5 + + strategy: + matrix: + node-version: [21.x] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: npm install, build + run: | + npm install + npm run build --if-present + npm run lint + env: + CI: true + - name: Run tape tests + run: | + npm run build-tests + xvfb-run --server-args="-screen 0 1920x1080x24" npm run test-tape-run From d41b38e8108e465a966be5d048461b30a596e4a4 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 22 Apr 2024 14:49:43 -0700 Subject: [PATCH 2/3] wip --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d717c0..64ec001 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "lint": "eslint \"./**/*.{ts,js}\"", "build-tests": "esbuild test/index.ts --target=es2020 --bundle --keep-names > test/test-bundle.js", "test": "npm run lint && npm run build && npm run build-tests && npm run test-tape-run", - "test-tape-run": "concurrently --kill-signal=SIGINT --kill-others \"npx partykit dev\" \"cat test/index.html | npx tape-run --input=html --static=test | npx tap-spec\"", + "test-tape-run": "concurrently --success first --kill-signal=SIGINT --kill-others \"npx partykit dev\" \"cat test/index.html | npx tape-run --input=html --static=test | npx tap-spec\"", "build-cjs": "esbuild src/*.ts --format=cjs --keep-names --tsconfig=tsconfig.build.json --outdir=./dist --out-extension:.js=.cjs --sourcemap=inline", "build-esm": "tsc --project tsconfig.build.json", "build": "mkdir -p ./dist && rm -rf ./dist/* && npm run build-cjs && npm run build-esm", From 56f249b3c65f2b7d1e3d3adce9f2a4eddb7b37df Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 22 Apr 2024 14:55:12 -0700 Subject: [PATCH 3/3] fix the CI command --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2fcd624..d6e0192 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # link +[![tests](https://github.com/bicycle-codes/link/actions/workflows/nodejs.yml/badge.svg)](https://github.com/bicycle-codes/link/actions/workflows/nodejs.yml) [![types](https://img.shields.io/npm/types/@bicycle-codes/link?style=flat-square)](README.md) [![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md) [![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)