Skip to content

feat(sync-service): Move WHERE clause evaluation to single process #775

feat(sync-service): Move WHERE clause evaluation to single process

feat(sync-service): Move WHERE clause evaluation to single process #775

Workflow file for this run

name: TS tests
on:
push:
branches: ['main']
pull_request:
permissions:
contents: read
jobs:
list_ts_packages:
name: List packages
runs-on: ubuntu-latest
outputs:
directories: ${{ steps.list_ts_packages.outputs.directories }}
steps:
- uses: actions/checkout@v4
- run: echo "directories=`find packages/ -mindepth 1 -maxdepth 1 -type d -exec test -e '{}'/tsconfig.json \; -print | jq -R -s -c 'split("\n")[:-1]'`" >> $GITHUB_OUTPUT
id: list_ts_packages
list_examples:
name: List examples
runs-on: ubuntu-latest
outputs:
example_names: ${{ steps.list_examples.outputs.example_names }}
steps:
- uses: actions/checkout@v4
- run: echo "example_names=`find examples/ -mindepth 1 -maxdepth 1 -type d | jq -R -s -c 'split("\n")[:-1]'`" >> $GITHUB_OUTPUT
id: list_examples
check_packages:
name: Check ${{ matrix.package_dir }}
needs: [list_ts_packages]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package_dir: ${{ fromJson(needs.list_ts_packages.outputs.directories) }}
defaults:
run:
working-directory: ${{ matrix.package_dir }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm -r --filter "$(jq '.name' -r package.json)^..." build
- run: pnpm run stylecheck
- run: pnpm run typecheck
build_and_test_packages:
name: Build and test
needs: [list_ts_packages]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package_dir: ${{ fromJson(needs.list_ts_packages.outputs.directories) }}
defaults:
run:
working-directory: ${{ matrix.package_dir }}
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
version-type: strict
version-file: '.tool-versions'
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: packages/sync-service/deps
key: ${{ runner.os }}-mix-${{ hashFiles('packages/sync-service/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Restore compiled code
uses: actions/cache@v4
with:
path: |
packages/sync-service/_build/*/lib
!packages/sync-service/_build/*/lib/electric
key: ${{ runner.os }}-build-dev-${{ hashFiles('packages/sync-service/mix.lock') }}
- name: Install dependencies
run: mix deps.get && mix deps.compile
working-directory: packages/sync-service
- name: Compiles without warnings
run: mix compile --force --all-warnings --warnings-as-errors
working-directory: packages/sync-service
- uses: JarvusInnovations/background-action@v1
name: Bootstrap System Under Test (SUT)
with:
run: |
mix start_dev
mix run --no-halt &
wait-on: |
http://localhost:3000
tail: true
log-output-resume: stderr
wait-for: 1m
log-output: true
log-output-if: failure
working-directory: packages/sync-service
- name: build dependencies, if any
run: pnpm -r --filter "$(jq '.name' -r package.json)^..." build
- run: pnpm test
check_and_build_examples:
name: Check and build ${{ matrix.example_folder }}
needs: [list_examples, build_and_test_packages]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example_folder: ${{ fromJson(needs.list_examples.outputs.example_names) }}
defaults:
run:
working-directory: ${{ matrix.example_folder }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm -r --filter "$(jq '.name' -r package.json)^..." build
- run: pnpm --if-present run typecheck
- run: pnpm --if-present run build
- run: pnpm --if-present run test
- run: pnpm --if-present run stylecheck