Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 29 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,54 @@ name: Test
on:
push:
branches:
- main
- main
pull_request:

permissions:
content: read

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
nodes: ${{ steps.nodes.outputs.nodes }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- name: Setup Node Version Matrix
id: nodes
run: |
NODES=$(npx -y @pkgjs/nv ls supported | jq '. | .version' | paste -sd "," -)
echo "nodes=[${NODES}]" >> $GITHUB_OUTPUT

lint:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v6
- name: Use Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 24.x
- run: npm i
- run: npm run lint

test:
# uses: pkgjs/action/.github/workflows/node-test.yaml@v0
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
node-version: ${{ fromJson(needs.setup.outputs.nodes) }}
steps:
- uses: actions/checkout@v4
- name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install and test
run: npm it
- uses: actions/checkout@v6
- name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: npm install and test
run: npm it
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
"create-package-json": "bin/create-package-json"
},
"scripts": {
"test": "semistandard && mocha",
"test": "mocha",
"test:debug": "mocha --inspect --inspect-brk --timeout=0",
"test:cover": "c8 mocha",
"lint": "semistandard",
"lint:fix": "semistandard --fix",
"debug": "mocha --inspect --inspect-brk",
"release": "npm t && standard-version && npm publish",
"postpublish": "git push && git push --tags"
"prerelease": "npm run lint && npm test && standard-version && npm login",
"release": "npm publish --access=public --tag=\"${1:-latest}\"",
"postrelease": "(npm logout || true) && git push --follow-tags && gh release create --draft --generate-notes \"v$(cat package.json | jq -r .version)\""
},
"repository": {
"type": "git",
Expand Down