changeset typo #2532
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: | |
| - '**' | |
| jobs: | |
| 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 | |
| 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: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # The mongodb-github-action below doesn't use the Docker credentials for the pull. | |
| # We pre-pull, so that the image is cached. | |
| - name: Pre-pull Mongo image | |
| run: docker pull mongo:8.0 | |
| - name: Start MongoDB | |
| uses: supercharge/[email protected] | |
| with: | |
| mongodb-version: '8.0' | |
| mongodb-replica-set: test-rs | |
| - 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: Build | |
| shell: bash | |
| run: pnpm build | |
| - name: Test | |
| run: pnpm --filter '!./modules/*' test | |
| run-postgres-tests: | |
| name: Postgres Test | |
| runs-on: ubuntu-latest | |
| needs: run-core-tests | |
| 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 | |
| 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) | |
| run: | | |
| docker run \ | |
| --health-cmd pg_isready \ | |
| --health-interval 10s \ | |
| --health-timeout 5s \ | |
| --health-retries 5 \ | |
| -e POSTGRES_PASSWORD=postgres \ | |
| -e POSTGRES_DB=powersync_storage_test \ | |
| -p 5431:5432 \ | |
| -d postgres:${{ matrix.postgres-version }} | |
| # The mongodb-github-action below doesn't use the Docker credentials for the pull. | |
| # We pre-pull, so that the image is cached. | |
| - name: Pre-pull Mongo image | |
| run: docker pull mongo:8.0 | |
| - name: Start MongoDB | |
| uses: supercharge/[email protected] | |
| with: | |
| mongodb-version: '8.0' | |
| mongodb-replica-set: test-rs | |
| - 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: Build | |
| shell: bash | |
| run: pnpm build | |
| - name: Test Replication | |
| run: pnpm --filter='./modules/module-postgres' test | |
| - 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 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| mysql-version: [5.7, 8.0, 8.4] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Login to Docker Hub | |
| 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 | |
| # The mongodb-github-action below doesn't use the Docker credentials for the pull. | |
| # We pre-pull, so that the image is cached. | |
| - name: Pre-pull Mongo image | |
| run: docker pull mongo:8.0 | |
| - name: Start MongoDB | |
| uses: supercharge/[email protected] | |
| with: | |
| mongodb-version: '8.0' | |
| mongodb-replica-set: test-rs | |
| - name: Start PostgreSQL (Storage) | |
| run: | | |
| docker run \ | |
| --health-cmd pg_isready \ | |
| --health-interval 10s \ | |
| --health-timeout 5s \ | |
| --health-retries 5 \ | |
| -e POSTGRES_PASSWORD=postgres \ | |
| -e POSTGRES_DB=powersync_storage_test \ | |
| -p 5431:5432 \ | |
| -d postgres:18 | |
| - 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: Build | |
| shell: bash | |
| run: pnpm build | |
| - name: Test Replication | |
| run: pnpm --filter='./modules/module-mysql' test | |
| run-mongodb-tests: | |
| name: MongoDB 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 | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # The mongodb-github-action below doesn't use the Docker credentials for the pull. | |
| # We pre-pull, so that the image is cached. | |
| - name: Pre-pull Mongo image | |
| run: docker pull mongo:${{ matrix.mongodb-version }} | |
| - name: Start MongoDB | |
| uses: supercharge/[email protected] | |
| with: | |
| mongodb-version: ${{ matrix.mongodb-version }} | |
| mongodb-replica-set: test-rs | |
| - name: Start PostgreSQL (Storage) | |
| run: | | |
| docker run \ | |
| --health-cmd pg_isready \ | |
| --health-interval 10s \ | |
| --health-timeout 5s \ | |
| --health-retries 5 \ | |
| -e POSTGRES_PASSWORD=postgres \ | |
| -e POSTGRES_DB=powersync_storage_test \ | |
| -p 5431:5432 \ | |
| -d postgres:18 | |
| - 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: Build | |
| shell: bash | |
| run: pnpm build | |
| - name: Test Replication | |
| run: pnpm --filter='./modules/module-mongodb' test | |
| - name: Test Storage | |
| run: pnpm --filter='./modules/module-mongodb-storage' test |