2024-03-15 08:51:40 +01:00
|
|
|
name: Run Unit Tests
|
2024-03-15 07:50:51 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2024-03-15 08:51:40 +01:00
|
|
|
ref:
|
|
|
|
description: 'Branch/Tag/SHA to test'
|
2024-03-15 07:50:51 +01:00
|
|
|
required: true
|
|
|
|
pull_request:
|
2024-03-15 08:51:40 +01:00
|
|
|
push:
|
2024-03-15 07:50:51 +01:00
|
|
|
|
|
|
|
jobs:
|
2024-03-15 08:51:40 +01:00
|
|
|
run-unit-tests:
|
2024-03-17 06:36:13 +01:00
|
|
|
name: Run Unit Tests
|
2024-03-15 07:50:51 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-03-17 06:36:13 +01:00
|
|
|
- name: Checkout (push/pull request)
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
if: github.event_name != 'workflow_dispatch'
|
|
|
|
|
|
|
|
- name: Checkout (workflow_dispatch)
|
2024-03-15 07:50:51 +01:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-03-17 06:57:28 +01:00
|
|
|
ref: ${{ inputs.ref }}
|
2024-03-17 06:36:13 +01:00
|
|
|
if: github.event_name == 'workflow_dispatch'
|
2024-03-15 07:50:51 +01:00
|
|
|
|
|
|
|
- name: Set up Node.js
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: npm test
|