Skip to content
Merged
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
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- "main"
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
pull_request:
branches:
- "main"

workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
type: choice
options:
- info
- warning
- debug

jobs:
test:
runs-on: ubuntu-latest
name: Run unit and integration tests
strategy:
matrix:
version: [18, 20]
steps:
- uses: actions/checkout@v4
- name: Using Node.js ${{ matrix.version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test

build_and_publish:
needs: [test]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Publish
run: npm publish
env:
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_TOKEN }}