Skip to content

Commit

Permalink
Merge pull request #8 from bherbruck/tests
Browse files Browse the repository at this point in the history
Tests
  • Loading branch information
bherbruck authored Nov 29, 2023
2 parents 5bc2854 + f22734b commit 856b477
Show file tree
Hide file tree
Showing 6 changed files with 2,503 additions and 196 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build --if-present

- name: Run tests
run: npm test
18 changes: 14 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,27 @@ name: Publish Package to npmjs
on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish

- name: Install Dependencies
run: npm ci

- name: Run Tests
run: npm test

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit 856b477

Please sign in to comment.