mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-02 05:04:13 +01:00
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
name: Run Unit Tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: 'Branch/Tag/SHA to test'
|
|
required: true
|
|
pull_request:
|
|
push:
|
|
|
|
jobs:
|
|
run-unit-tests:
|
|
name: Run Unit Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout (push/pull request)
|
|
uses: actions/checkout@v4
|
|
if: github.event_name != 'workflow_dispatch'
|
|
|
|
- name: Checkout (workflow_dispatch)
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ inputs.ref }}
|
|
if: github.event_name == 'workflow_dispatch'
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Install libnusqlite3
|
|
run: |
|
|
curl -fsSL -o /tmp/libnusqlite3.zip "https://github.com/mikiher/nunicode-sqlite/releases/download/v1.2/libnusqlite3-linux-x64.zip"
|
|
unzip -o /tmp/libnusqlite3.zip -d /tmp/nusqlite3
|
|
echo "NUSQLITE3_PATH=/tmp/nusqlite3/libnusqlite3.so" >> "$GITHUB_ENV"
|
|
rm /tmp/libnusqlite3.zip
|
|
|
|
- name: Run lint
|
|
run: npm run lint
|
|
|
|
- name: Run tests
|
|
run: npm test
|