Skip to content

Commit

Permalink
Merge pull request #25 from lisb/feature/add-ci-workflow
Browse files Browse the repository at this point in the history
chore(workflow): add CI workflow
  • Loading branch information
krdlab authored Nov 22, 2024
2 parents 9fac613 + bc8c31b commit fbb0d5b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 18 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: build and test

on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read

defaults:
run:
shell: bash

jobs:
test:
strategy:
matrix:
node:
- 18.x
- 20.x
- 22.x
os:
- ubuntu-latest
- windows-latest
- macos-latest

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Run tests
run: |
npm install
# TODO: npm test
21 changes: 3 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,13 @@ on:
types: [created]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 16, 18, 20 ]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- run: npm install
# TODO: - run: npm test

publish-npm:
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
Expand Down

0 comments on commit fbb0d5b

Please sign in to comment.