Skip to content

Run test on gh-actions #2

Run test on gh-actions

Run test on gh-actions #2

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [published]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test on Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [20, 22]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
# publish:
# if: github.event_name == 'release' && github.event.action == 'published'
# name: Publish to npm
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Use Node.js 20
# uses: actions/setup-node@v4
# with:
# node-version: 20
# registry-url: 'https://registry.npmjs.org'
# cache: 'npm'
# - name: Install dependencies
# run: npm ci
# - name: Publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: npm publish --access public