mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-05-13 11:01:16 +00:00
Add actions
This commit is contained in:
60
.github/workflows/harness-ci.yml
vendored
Normal file
60
.github/workflows/harness-ci.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
# Run tests with optional coverage reporting (Harnessed CI)
|
||||||
|
name: harness-ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
coverage:
|
||||||
|
description: 'Run with coverage'
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
required: false
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '24.x'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Install test dependencies (Playwright Chromium)
|
||||||
|
run: npm run test:install-dependencies
|
||||||
|
|
||||||
|
- name: Start test services (CouchDB + MinIO)
|
||||||
|
run: npm run test:docker-all:start
|
||||||
|
|
||||||
|
- name: Run tests (no coverage)
|
||||||
|
if: ${{ inputs.coverage == false }}
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Run tests with coverage
|
||||||
|
if: ${{ inputs.coverage == true }}
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
run: npm run test:coverage
|
||||||
|
|
||||||
|
- name: Upload coverage artifact
|
||||||
|
if: ${{ inputs.coverage && always() }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: coverage
|
||||||
|
path: coverage/
|
||||||
|
|
||||||
|
- name: Stop test services
|
||||||
|
if: always()
|
||||||
|
run: npm run test:docker-all:stop
|
||||||
Reference in New Issue
Block a user