Skip to content

Commit

Permalink
ci: use reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jan 17, 2025
1 parent e323432 commit f83bc24
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 65 deletions.
64 changes: 4 additions & 60 deletions .github/workflows/test-js.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,8 @@
name: Run JS tests
name: Run tests
on:
- push
- pull_request
jobs:
bun:
name: Bun
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
- run: bun install
- run: bun run build
- run: bun test/index.js
deno:
name: Deno
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- uses: denoland/setup-deno@909cc5acb0fdd60627fb858598759246509fa755 # v2.0.2
- run: deno install
- run: deno task build
- run: deno --allow-env --allow-read test/index.js
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm install
- run: npm run build --if-present
- run: npm run lint --if-present
node:
name: Node v${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20, 22]
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm install
- run: npm run build --if-present
- run: npm test
coverage:
name: Measure coverage on Node
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm install
- run: npm run build --if-present
- run: npm run test:coverage --if-present
test-js:
name: 'JS v0.2.2' # v0.2.2 == commit below
uses: paulmillr/jsbt/.github/workflows/test-js.yml@986dbfea9667eeb0e81bf606cbe9ed169fea89b2
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ Check out [Projects using scure-base](#projects-using-scure-base).

> `npm install @scure/base`
> `deno add @scure/base`
> `deno add jsr:@scure/base`
> `deno doc jsr:@scure/base` # command-line documentation

We support all major platforms and runtimes. The library is hybrid ESM / Common.js package.

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"lib/esm/package.json",
"index.ts"
],
"main": "lib/index.js",
"module": "lib/esm/index.js",
"types": "lib/index.d.ts",
"main": "./lib/index.js",
"module": "./lib/esm/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./lib/esm/index.js",
Expand All @@ -29,7 +29,8 @@
"lint": "prettier --check index.ts",
"format": "prettier --write index.ts",
"test": "node test/index.js",
"test:deno": "deno test test/deno.ts"
"test:bun": "bun test/index.js",
"test:deno": "deno --allow-env --allow-read test/index.js && deno test/deno.ts"
},
"sideEffects": false,
"author": "Paul Miller (https://paulmillr.com)",
Expand Down

0 comments on commit f83bc24

Please sign in to comment.