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 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/) 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",