From 4a9d6c134948236981866e5a649f0938fad68796 Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Thu, 7 May 2026 11:23:51 +0100 Subject: [PATCH] Add ci --- .github/workflows/cli-deno-tests.yml | 75 ++++++++++++++++++++++++++ src/apps/cli/testdeno/test_dev_deno.md | 6 +++ 2 files changed, 81 insertions(+) create mode 100644 .github/workflows/cli-deno-tests.yml diff --git a/.github/workflows/cli-deno-tests.yml b/.github/workflows/cli-deno-tests.yml new file mode 100644 index 0000000..b2b4d13 --- /dev/null +++ b/.github/workflows/cli-deno-tests.yml @@ -0,0 +1,75 @@ +name: cli-deno-tests + +on: + workflow_dispatch: + inputs: + test_task: + description: 'Deno test task to run' + type: choice + options: + - test + - test:local + - test:e2e-matrix + - test:p2p-sync + default: test + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 60 + 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: Setup Deno + uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + + - name: Install dependencies + run: npm ci + + - name: Build CLI + working-directory: src/apps/cli + run: npm run build + + - name: Create .test.env + working-directory: src/apps/cli + run: | + cat < .test.env + hostname=http://127.0.0.1:5989/ + dbname=livesync-test-db-ci + username=admin + password=testpassword + minioEndpoint=http://127.0.0.1:9000 + accessKey=minioadmin + secretKey=minioadmin + bucketName=livesync-test-bucket-ci + EOF + + - name: Run Deno tests + working-directory: src/apps/cli/testdeno + env: + LIVESYNC_DOCKER_MODE: native + LIVESYNC_CLI_RETRY: 3 + run: | + TASK="${{ github.event_name == 'workflow_dispatch' && inputs.test_task || 'test' }}" + echo "[INFO] Running Deno task: $TASK" + deno task "$TASK" + + - name: Stop leftover containers + if: always() + run: | + docker stop couchdb-test minio-test relay-test >/dev/null 2>&1 || true + docker rm couchdb-test minio-test relay-test >/dev/null 2>&1 || true diff --git a/src/apps/cli/testdeno/test_dev_deno.md b/src/apps/cli/testdeno/test_dev_deno.md index 521661a..acc07ba 100644 --- a/src/apps/cli/testdeno/test_dev_deno.md +++ b/src/apps/cli/testdeno/test_dev_deno.md @@ -279,6 +279,12 @@ deno task test:sync-two-local --- +## 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. + +--- + ## Current limitations - MinIO startup and matrix coverage are ported. Current limits are elsewhere, not setup URI generation.