mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-21 08:42:31 +00:00
Update CI to use deno
This commit is contained in:
@@ -1,17 +1,39 @@
|
|||||||
name: cli-deno-tests
|
name: cli-deno-tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- beta
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/cli-deno-tests.yml'
|
||||||
|
- 'src/apps/cli/**'
|
||||||
|
- 'src/lib/src/API/processSetting.ts'
|
||||||
|
- 'package.json'
|
||||||
|
- 'package-lock.json'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/cli-deno-tests.yml'
|
||||||
|
- 'src/apps/cli/**'
|
||||||
|
- 'src/lib/src/API/processSetting.ts'
|
||||||
|
- 'package.json'
|
||||||
|
- 'package-lock.json'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
test_task:
|
test_task:
|
||||||
description: 'Deno test task to run'
|
description: 'Deno test task to run'
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
- test
|
- test:ci
|
||||||
|
- test:p2p
|
||||||
|
- test:all
|
||||||
- test:local
|
- test:local
|
||||||
- test:e2e-matrix
|
- test:e2e-matrix
|
||||||
- test:p2p-sync
|
default: test:ci
|
||||||
default: test
|
enable_debug:
|
||||||
|
description: 'Enable verbose and debug logging'
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -27,11 +49,17 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
SELECTED_TASK="${{ github.event_name == 'workflow_dispatch' && inputs.test_task || 'test' }}"
|
SELECTED_TASK="${{ github.event_name == 'workflow_dispatch' && inputs.test_task || 'test:ci' }}"
|
||||||
echo "[INFO] Selected task set: $SELECTED_TASK"
|
echo "[INFO] Selected task set: $SELECTED_TASK"
|
||||||
|
|
||||||
case "$SELECTED_TASK" in
|
case "$SELECTED_TASK" in
|
||||||
test)
|
test:ci)
|
||||||
|
TASK_MATRIX='["test:setup-put-cat","test:mirror","test:push-pull","test:sync-two-local","test:sync-locked-remote","test:e2e-matrix:couchdb-enc0","test:e2e-matrix:couchdb-enc1","test:e2e-matrix:minio-enc0","test:e2e-matrix:minio-enc1"]'
|
||||||
|
;;
|
||||||
|
test:p2p)
|
||||||
|
TASK_MATRIX='["test:p2p-host","test:p2p-peers","test:p2p-sync","test:p2p-three-nodes","test:p2p-upload-download"]'
|
||||||
|
;;
|
||||||
|
test:all)
|
||||||
TASK_MATRIX='["test:setup-put-cat","test:mirror","test:push-pull","test:sync-two-local","test:sync-locked-remote","test:p2p-host","test:p2p-peers","test:p2p-sync","test:p2p-three-nodes","test:p2p-upload-download","test:e2e-matrix:couchdb-enc0","test:e2e-matrix:couchdb-enc1","test:e2e-matrix:minio-enc0","test:e2e-matrix:minio-enc1"]'
|
TASK_MATRIX='["test:setup-put-cat","test:mirror","test:push-pull","test:sync-two-local","test:sync-locked-remote","test:p2p-host","test:p2p-peers","test:p2p-sync","test:p2p-three-nodes","test:p2p-upload-download","test:e2e-matrix:couchdb-enc0","test:e2e-matrix:couchdb-enc1","test:e2e-matrix:minio-enc0","test:e2e-matrix:minio-enc1"]'
|
||||||
;;
|
;;
|
||||||
test:local)
|
test:local)
|
||||||
@@ -40,9 +68,6 @@ jobs:
|
|||||||
test:e2e-matrix)
|
test:e2e-matrix)
|
||||||
TASK_MATRIX='["test:e2e-matrix:couchdb-enc0","test:e2e-matrix:couchdb-enc1","test:e2e-matrix:minio-enc0","test:e2e-matrix:minio-enc1"]'
|
TASK_MATRIX='["test:e2e-matrix:couchdb-enc0","test:e2e-matrix:couchdb-enc1","test:e2e-matrix:minio-enc0","test:e2e-matrix:minio-enc1"]'
|
||||||
;;
|
;;
|
||||||
test:p2p-sync)
|
|
||||||
TASK_MATRIX='["test:p2p-sync"]'
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "[ERROR] Unknown task set: $SELECTED_TASK" >&2
|
echo "[ERROR] Unknown task set: $SELECTED_TASK" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -113,6 +138,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
LIVESYNC_DOCKER_MODE: native
|
LIVESYNC_DOCKER_MODE: native
|
||||||
LIVESYNC_CLI_RETRY: 3
|
LIVESYNC_CLI_RETRY: 3
|
||||||
|
LIVESYNC_CLI_DEBUG: ${{ inputs.enable_debug == true && '1' || '0' }}
|
||||||
|
LIVESYNC_CLI_VERBOSE: ${{ inputs.enable_debug == true && '1' || '0' }}
|
||||||
run: |
|
run: |
|
||||||
TASK="${{ matrix.task }}"
|
TASK="${{ matrix.task }}"
|
||||||
echo "[INFO] Running Deno task: $TASK"
|
echo "[INFO] Running Deno task: $TASK"
|
||||||
|
|||||||
@@ -12,23 +12,6 @@ on:
|
|||||||
- two-vaults-couchdb
|
- two-vaults-couchdb
|
||||||
- two-vaults-minio
|
- two-vaults-minio
|
||||||
default: two-vaults-matrix
|
default: two-vaults-matrix
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- beta
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/cli-e2e.yml'
|
|
||||||
- 'src/apps/cli/**'
|
|
||||||
- 'src/lib/src/API/processSetting.ts'
|
|
||||||
- 'package.json'
|
|
||||||
- 'package-lock.json'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/cli-e2e.yml'
|
|
||||||
- 'src/apps/cli/**'
|
|
||||||
- 'src/lib/src/API/processSetting.ts'
|
|
||||||
- 'package.json'
|
|
||||||
- 'package-lock.json'
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@@ -84,6 +84,9 @@ export async function maybeStartLocalRelay(relay: string): Promise<boolean> {
|
|||||||
intervalMs: Number(Deno.env.get("LIVESYNC_P2P_RELAY_READY_INTERVAL_MS") ?? "250"),
|
intervalMs: Number(Deno.env.get("LIVESYNC_P2P_RELAY_READY_INTERVAL_MS") ?? "250"),
|
||||||
connectTimeoutMs: Number(Deno.env.get("LIVESYNC_P2P_RELAY_CONNECT_TIMEOUT_MS") ?? "1000"),
|
connectTimeoutMs: Number(Deno.env.get("LIVESYNC_P2P_RELAY_CONNECT_TIMEOUT_MS") ?? "1000"),
|
||||||
});
|
});
|
||||||
|
// Docker proxy accepts TCP connections instantly before the container's internal process is fully ready.
|
||||||
|
// Wait an additional few seconds to ensure strfry is actually accepting WebSockets.
|
||||||
|
await sleep(3000);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ deno task test:sync-two-local
|
|||||||
|
|
||||||
## Continuous Integration
|
## Continuous Integration
|
||||||
|
|
||||||
The GitHub Actions workflow `.github/workflows/cli-deno-tests.yml` is used to run these tests automatically on push and pull requests affecting the CLI.
|
The GitHub Actions workflow `.github/workflows/cli-deno-tests.yml` runs automatically on pushes and pull requests affecting the CLI, executing the non-P2P test suite (`test:ci`). P2P tests (`test:p2p`) are excluded from automatic execution and must be run via manual dispatch (`workflow_dispatch`). You can optionally check the "Enable verbose and debug logging" checkbox during a manual dispatch to produce detailed trace logs for troubleshooting.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user