mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-06-12 17:30:17 +00:00
295dc1392a
- Fixed an issue where using fast synchronisation caused a TypeError in some environments (#953).
111 lines
2.6 KiB
YAML
111 lines
2.6 KiB
YAML
# Run Unit test without Harnesses
|
|
name: unit-ci
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
- beta
|
|
paths:
|
|
- 'src/**'
|
|
- 'test/**'
|
|
- 'package.json'
|
|
- 'package-lock.json'
|
|
- 'tsconfig.json'
|
|
- 'vite.config.ts'
|
|
- 'vitest.config*.ts'
|
|
- 'esbuild.config.mjs'
|
|
- 'eslint.config.mjs'
|
|
- '.github/workflows/unit-ci.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'src/**'
|
|
- 'test/**'
|
|
- 'package.json'
|
|
- 'package-lock.json'
|
|
- 'tsconfig.json'
|
|
- 'vite.config.ts'
|
|
- 'vitest.config*.ts'
|
|
- 'esbuild.config.mjs'
|
|
- 'eslint.config.mjs'
|
|
- '.github/workflows/unit-ci.yml'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
unit-test:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24.x'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run unit tests suite with coverage
|
|
run: npm run test:unit:coverage
|
|
|
|
- name: Upload coverage report
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: unit-coverage-report
|
|
path: coverage/**
|
|
|
|
integration-test:
|
|
name: Integration Tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24.x'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Create environment configuration files
|
|
run: |
|
|
cat <<EOF > .env
|
|
BUILD_MODE=dev
|
|
PATHS_TEST_INSTALL=
|
|
EOF
|
|
cat <<EOF > .test.env
|
|
hostname=http://127.0.0.1:5989/
|
|
dbname=livesync-test-db2
|
|
username=admin
|
|
password=testpassword
|
|
minioEndpoint=http://127.0.0.1:9000
|
|
accessKey=minioadmin
|
|
secretKey=minioadmin
|
|
bucketName=livesync-test-bucket
|
|
EOF
|
|
|
|
- name: Start CouchDB container
|
|
run: npm run test:docker-couchdb:start
|
|
|
|
- name: Run integration tests
|
|
run: npm run test:integration
|
|
|
|
- name: Stop CouchDB container
|
|
if: always()
|
|
run: npm run test:docker-couchdb:stop || true
|