From 3b6d0b736befa16ff2a71395c2a8ec0a243f6f38 Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Fri, 12 Dec 2025 12:48:24 +0100 Subject: [PATCH 1/3] Split and rename Autoformatting workflow into separate formatting checks for TS and Elixir --- ...format.yml => elixir_check_formatting.yml} | 50 +++---------------- .github/workflows/ts_check_formatting.yml | 39 +++++++++++++++ 2 files changed, 47 insertions(+), 42 deletions(-) rename .github/workflows/{autoformat.yml => elixir_check_formatting.yml} (63%) create mode 100644 .github/workflows/ts_check_formatting.yml diff --git a/.github/workflows/autoformat.yml b/.github/workflows/elixir_check_formatting.yml similarity index 63% rename from .github/workflows/autoformat.yml rename to .github/workflows/elixir_check_formatting.yml index 82ad018b3e..42923fbc1c 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/elixir_check_formatting.yml @@ -1,55 +1,21 @@ -name: Autoformat & Linting - -# Note: For pull requests, GitHub Actions automatically creates a merge commit -# between your branch and the target branch (usually main), then runs checks on -# that merged state. This ensures the code will be properly formatted after merge. -# If this check fails, you may need to merge main into your branch first. +name: Elixir formatting on: - push: - branches: ['main'] - paths-ignore: - - '**/README.md' - - 'integration-tests/**' pull_request: - paths-ignore: - - '**/README.md' - - 'integration-tests/**' + paths: + - 'packages/electric-telemetry/**' + - 'packages/elixir-client/**' + - 'packages/sync-service/**' permissions: contents: read jobs: - typescript_formatting: - name: TypeScript formatting and linting - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.tool-versions' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Check Prettier formatting - run: pnpm run format:check - - - name: Check ESLint (all packages) - run: pnpm run stylecheck-all - - elixir_formatting: + elixir_check_formatting: strategy: matrix: package: [sync-service, elixir-client, electric-telemetry] - name: Elixir formatting and linting + name: Check Elixir formatting and compilation issues runs-on: ubuntu-latest defaults: run: @@ -98,5 +64,5 @@ jobs: - name: Check Elixir formatting run: mix format --check-formatted - - name: Check Elixir compiles without warnings + - name: Check the package compiles without warnings run: mix compile --force --all-warnings --warnings-as-errors diff --git a/.github/workflows/ts_check_formatting.yml b/.github/workflows/ts_check_formatting.yml new file mode 100644 index 0000000000..866266c63b --- /dev/null +++ b/.github/workflows/ts_check_formatting.yml @@ -0,0 +1,39 @@ +name: TS formatting + +on: + pull_request: + paths-ignore: + - '**/README.md' + - 'integration-tests/**' + - 'packages/electric-telemetry/**' + - 'packages/elixir-client/**' + - 'packages/sync-service/**' + +permissions: + contents: read + +jobs: + ts_check_formatting: + name: Check formatting of TS packages, examples and website + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.tool-versions' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Check Prettier formatting + run: pnpm run format:check + + - name: Check ESLint (all packages) + run: pnpm run stylecheck-all From a25a878e90ab20b01e5f7f948a88897e82519cb1 Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Fri, 12 Dec 2025 12:54:50 +0100 Subject: [PATCH 2/3] Remove no longer used Mix config --- packages/elixir-client/mix.exs | 11 ----------- packages/sync-service/mix.exs | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/packages/elixir-client/mix.exs b/packages/elixir-client/mix.exs index 61a4765866..5d8992e8d2 100644 --- a/packages/elixir-client/mix.exs +++ b/packages/elixir-client/mix.exs @@ -17,17 +17,6 @@ defmodule Electric.Client.MixProject do package: package(), source_url: "#{@github_repo}/tree/main/packages/elixir-client", homepage_url: "https://electric-sql.com", - # This will go away after we upgrade Elixir to 1.19, which expects the public `cli/0` - # function to be defined instead. - preferred_cli_env: [ - dialyzer: :test, - coveralls: :test, - "coveralls.detail": :test, - "coveralls.post": :test, - "coveralls.html": :test, - "coveralls.cobertura": :test, - "coveralls.lcov": :test - ], test_coverage: [ tool: ExCoveralls, ignore_modules: [ diff --git a/packages/sync-service/mix.exs b/packages/sync-service/mix.exs index 889c837ed0..dc5ae5737b 100644 --- a/packages/sync-service/mix.exs +++ b/packages/sync-service/mix.exs @@ -33,17 +33,6 @@ defmodule Electric.MixProject do start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), - # This will go away after we upgrade Elixir to 1.19, which expects the public `cli/0` - # function to be defined instead. - preferred_cli_env: [ - dialyzer: :test, - coveralls: :test, - "coveralls.detail": :test, - "coveralls.post": :test, - "coveralls.html": :test, - "coveralls.cobertura": :test, - "coveralls.lcov": :test - ], releases: [ electric: [ applications: @telemetry_applications_in_release, From 3bea9447b5fb4e02833f8c8125702a5cb2c0c7ee Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Fri, 12 Dec 2025 13:02:18 +0100 Subject: [PATCH 3/3] Fix cache keys in Elixir formatting workflow --- .github/workflows/elixir_check_formatting.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/elixir_check_formatting.yml b/.github/workflows/elixir_check_formatting.yml index 42923fbc1c..4a7a963410 100644 --- a/.github/workflows/elixir_check_formatting.yml +++ b/.github/workflows/elixir_check_formatting.yml @@ -38,11 +38,11 @@ jobs: uses: actions/cache/restore@v4 with: path: packages/${{ matrix.package }}/deps - key: "${{ runner.os }}-${{ matrix.package }}-deps-${{ env.MIX_ENV }}-${{ hashFiles('packages/${{ matrix.package }}/mix.lock') }}" + key: "${{ runner.os }}-${{ matrix.package }}-deps-${{ env.MIX_ENV }}-${{ hashFiles(format('packages/{0}/mix.lock', matrix.package)) }}" restore-keys: | - ${{ runner.os }}-${{ matrix.package }}-deps-${{ env.MIX_ENV }}-${{ hashFiles('packages/${{ matrix.package }}/mix.lock') }} - ${{ runner.os }}-${{ matrix.package }}-deps-${{ env.MIX_ENV }}- - ${{ runner.os }}-${{ matrix.package }}-deps- + ${{ runner.os }}-${{ matrix.package }}-deps-${{ env.MIX_ENV }}-${{ hashFiles(format('packages/{0}/mix.lock', matrix.package)) }} + ${{ runner.os }}-${{ matrix.package }}-deps-${{ env.MIX_ENV }} + ${{ runner.os }}-${{ matrix.package }}-deps - name: Restore compiled code uses: actions/cache/restore@v4 @@ -52,11 +52,11 @@ jobs: !packages/${{ matrix.package }}/_build/*/lib/electric !packages/${{ matrix.package }}/_build/*/lib/electric_client !packages/${{ matrix.package }}/_build/*/lib/electric_telemetry - key: "${{ runner.os }}-${{ matrix.package }}-build-${{ env.MIX_ENV }}-${{ hashFiles('packages/${{ matrix.package }}/mix.lock') }}" + key: "${{ runner.os }}-${{ matrix.package }}-build-${{ env.MIX_ENV }}-${{ hashFiles(format('packages/{0}/mix.lock', matrix.package)) }}" restore-keys: | - ${{ runner.os }}-${{ matrix.package }}-build-${{ env.MIX_ENV }}-${{ hashFiles('packages/${{ matrix.package }}/mix.lock') }} - ${{ runner.os }}-${{ matrix.package }}-build-${{ env.MIX_ENV }}- - ${{ runner.os }}-${{ matrix.package }}-build- + ${{ runner.os }}-${{ matrix.package }}-build-${{ env.MIX_ENV }}-${{ hashFiles(format('packages/{0}/mix.lock', matrix.package)) }} + ${{ runner.os }}-${{ matrix.package }}-build-${{ env.MIX_ENV }} + ${{ runner.os }}-${{ matrix.package }}-build - name: Install dependencies run: mix deps.get