chore: delete and regenerate stale v5 snapshots #5072
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - '**' | |
| permissions: | |
| contents: read | |
| jobs: | |
| format-check: | |
| name: Linting | |
| if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Validate tsconfig references | |
| run: pnpm validate:tsconfig-references | |
| - name: Check formatting | |
| run: pnpm format:check | |
| test-service-container-build: | |
| name: Build and Test PowerSync Service | |
| if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Test Build Docker Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| cache-from: type=registry,ref=stevenontong/${{vars.DOCKER_REGISTRY}}:cache | |
| context: . | |
| platforms: linux/amd64 | |
| push: false | |
| file: ./service/Dockerfile | |
| run-core-tests: | |
| name: Core Test | |
| if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Node and build | |
| uses: ./.github/actions/setup-node-build | |
| - name: Test | |
| run: pnpm test:core | |
| run-postgres-replication-tests: | |
| name: Postgres Replication Test | |
| runs-on: ubuntu-latest | |
| needs: run-core-tests | |
| env: | |
| PG_STORAGE_TEST_URL: postgres://postgres:postgres@localhost:5431/powersync_storage_test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| postgres-version: [11, 12, 13, 14, 15, 16, 17, 18] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Start PostgreSQL | |
| run: | | |
| docker run \ | |
| --health-cmd pg_isready \ | |
| --health-interval 10s \ | |
| --health-timeout 5s \ | |
| --health-retries 5 \ | |
| -e POSTGRES_PASSWORD=postgres \ | |
| -e POSTGRES_DB=powersync_test \ | |
| -p 5432:5432 \ | |
| -d postgres:${{ matrix.postgres-version }} \ | |
| -c wal_level=logical | |
| - name: Start PostgreSQL (Storage) | |
| uses: ./.github/actions/start-postgres-storage | |
| with: | |
| postgres-version: ${{ matrix.postgres-version }} | |
| - name: Start MongoDB | |
| uses: ./.github/actions/start-mongodb | |
| - name: Setup Node and build | |
| uses: ./.github/actions/setup-node-build | |
| - name: Test Replication | |
| run: pnpm --filter='./modules/module-postgres' test | |
| run-postgres-storage-tests: | |
| name: Postgres Storage Test | |
| runs-on: ubuntu-latest | |
| needs: run-core-tests | |
| env: | |
| PG_STORAGE_TEST_URL: postgres://postgres:postgres@localhost:5431/powersync_storage_test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| postgres-version: [11, 12, 13, 14, 15, 16, 17, 18] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Start PostgreSQL | |
| run: | | |
| docker run \ | |
| --health-cmd pg_isready \ | |
| --health-interval 10s \ | |
| --health-timeout 5s \ | |
| --health-retries 5 \ | |
| -e POSTGRES_PASSWORD=postgres \ | |
| -e POSTGRES_DB=powersync_test \ | |
| -p 5432:5432 \ | |
| -d postgres:${{ matrix.postgres-version }} \ | |
| -c wal_level=logical | |
| - name: Start PostgreSQL (Storage) | |
| uses: ./.github/actions/start-postgres-storage | |
| with: | |
| postgres-version: ${{ matrix.postgres-version }} | |
| - name: Setup Node and build | |
| uses: ./.github/actions/setup-node-build | |
| - name: Test Storage | |
| run: pnpm --filter='./modules/module-postgres-storage' test | |
| run-mysql-tests: | |
| name: MySQL Test | |
| runs-on: ubuntu-latest | |
| needs: run-core-tests | |
| env: | |
| PG_STORAGE_TEST_URL: postgres://postgres:postgres@localhost:5431/powersync_storage_test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| mysql-version: [5.7, 8.0, 8.4] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Start MySQL | |
| run: | | |
| docker run \ | |
| --name MySQLTestDatabase \ | |
| -e MYSQL_ROOT_PASSWORD=mypassword \ | |
| -e MYSQL_DATABASE=mydatabase \ | |
| -p 3306:3306 \ | |
| -d mysql:${{ matrix.mysql-version }} \ | |
| --log-bin=/var/lib/mysql/mysql-bin.log \ | |
| --gtid_mode=ON \ | |
| --enforce_gtid_consistency=ON \ | |
| --server-id=1 | |
| - name: Start MongoDB | |
| uses: ./.github/actions/start-mongodb | |
| - name: Start PostgreSQL (Storage) | |
| uses: ./.github/actions/start-postgres-storage | |
| - name: Setup Node and build | |
| uses: ./.github/actions/setup-node-build | |
| - name: Test Replication | |
| run: pnpm --filter='./modules/module-mysql' test | |
| run-mongodb-replication-tests: | |
| name: MongoDB Replication Test | |
| runs-on: ubuntu-latest | |
| needs: run-core-tests | |
| env: | |
| PG_STORAGE_TEST_URL: postgres://postgres:postgres@localhost:5431/powersync_storage_test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| mongodb-version: ['6.0', '7.0', '8.0'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Start MongoDB | |
| uses: ./.github/actions/start-mongodb | |
| with: | |
| mongodb-version: ${{ matrix.mongodb-version }} | |
| - name: Start PostgreSQL (Storage) | |
| uses: ./.github/actions/start-postgres-storage | |
| - name: Setup Node and build | |
| uses: ./.github/actions/setup-node-build | |
| - name: Test Replication | |
| run: pnpm --filter='./modules/module-mongodb' test | |
| run-convex-replication-tests: | |
| name: Convex Replication Test | |
| runs-on: ubuntu-latest | |
| needs: run-core-tests | |
| env: | |
| CONVEX_DEPLOYMENT: anonymous:anonymous-module-convex | |
| CONVEX_URL: http://127.0.0.1:3210 | |
| CONVEX_SITE_URL: http://127.0.0.1:3211 | |
| PG_STORAGE_TEST_URL: postgres://postgres:postgres@localhost:5431/powersync_storage_test | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Start MongoDB | |
| uses: ./.github/actions/start-mongodb | |
| - name: Start PostgreSQL (Storage) | |
| uses: ./.github/actions/start-postgres-storage | |
| - name: Setup Node and build | |
| uses: ./.github/actions/setup-node-build | |
| - name: Start Convex | |
| working-directory: modules/module-convex | |
| run: | | |
| # Start the local Convex backend in the background so the next test step can use it. | |
| pnpm run dev:convex > convex-dev.log 2>&1 & | |
| # Wait until Convex has generated its local admin key and the schema API is responding. | |
| timeout 120 bash -c ' | |
| until node --input-type=module -e '"'"' | |
| import fs from "node:fs"; | |
| const config = JSON.parse(fs.readFileSync(".convex/local/default/config.json", "utf8")); | |
| const response = await fetch("http://127.0.0.1:3210/api/json_schemas?format=json", { | |
| headers: { Authorization: `Convex ${config.adminKey}` } | |
| }); | |
| if (!response.ok) process.exit(1); | |
| '"'"'; do | |
| sleep 2 | |
| done | |
| ' | |
| - name: Test Replication | |
| run: pnpm --filter='./modules/module-convex' test | |
| - name: Print Convex logs | |
| if: failure() | |
| working-directory: modules/module-convex | |
| run: cat convex-dev.log | |
| run-mongodb-storage-tests: | |
| name: MongoDB Storage Test | |
| runs-on: ubuntu-latest | |
| needs: run-core-tests | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| mongodb-version: ['6.0', '7.0', '8.0'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Start MongoDB | |
| uses: ./.github/actions/start-mongodb | |
| with: | |
| mongodb-version: ${{ matrix.mongodb-version }} | |
| - name: Setup Node and build | |
| uses: ./.github/actions/setup-node-build | |
| - name: Test Storage | |
| run: pnpm --filter='./modules/module-mongodb-storage' test | |
| run-mssql-tests: | |
| name: MSSQL Test | |
| runs-on: ubuntu-latest | |
| needs: run-core-tests | |
| env: | |
| MSSQL_SA_PASSWORD: 321strong_ROOT_password | |
| PG_STORAGE_TEST_URL: postgres://postgres:postgres@localhost:5431/powersync_storage_test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| mssql-version: [2019, 2022, 2025] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Start MSSQL | |
| run: | | |
| docker run \ | |
| --name MSSQLTestDatabase \ | |
| --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P \"${{ env.MSSQL_SA_PASSWORD }}\" -Q \"SELECT 1;\" || exit 1" \ | |
| --health-interval 5s \ | |
| --health-timeout 3s \ | |
| --health-retries 30 \ | |
| -e ACCEPT_EULA=Y \ | |
| -e MSSQL_SA_PASSWORD=${{ env.MSSQL_SA_PASSWORD }} \ | |
| -e MSSQL_PID=Developer \ | |
| -e MSSQL_AGENT_ENABLED=true \ | |
| -p 1433:1433 \ | |
| -d mcr.microsoft.com/mssql/server:${{ matrix.mssql-version }}-latest | |
| - name: Wait for MSSQL to accept connections | |
| run: | | |
| timeout 120 bash -c 'until docker inspect --format="{{.State.Health.Status}}" MSSQLTestDatabase | grep -q "healthy"; do sleep 2; done' | |
| - name: Wait for MSSQL Server Agent to be running | |
| run: | | |
| timeout 120 bash -c ' | |
| until docker exec MSSQLTestDatabase /opt/mssql-tools18/bin/sqlcmd \ | |
| -C -S localhost -U sa -P "${{ env.MSSQL_SA_PASSWORD }}" \ | |
| -h -1 -W \ | |
| -Q "SELECT status_desc FROM sys.dm_server_services WHERE servicename LIKE '\''SQL Server Agent%'\'';" \ | |
| | grep -q "^Running$"; do | |
| sleep 2 | |
| done' | |
| - name: Initialize MSSQL database | |
| run: | | |
| docker run \ | |
| --rm \ | |
| --network host \ | |
| -e MSSQL_SA_PASSWORD=${{ env.MSSQL_SA_PASSWORD }} \ | |
| -v ${{ github.workspace }}/modules/module-mssql/ci/init-mssql.sql:/scripts/init-mssql.sql:ro \ | |
| mcr.microsoft.com/mssql/server:${{ matrix.mssql-version }}-latest \ | |
| /bin/bash -c "/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P \"${{ env.MSSQL_SA_PASSWORD }}\" -v DATABASE=powersync -v DB_USER=sa -i /scripts/init-mssql.sql" | |
| - name: Start MongoDB | |
| uses: ./.github/actions/start-mongodb | |
| - name: Start PostgreSQL (Storage) | |
| uses: ./.github/actions/start-postgres-storage | |
| - name: Setup Node and build | |
| uses: ./.github/actions/setup-node-build | |
| - name: Test Replication | |
| run: pnpm --filter='./modules/module-mssql' test |