Skip to content

Commit 0378ece

Browse files
nseaSebclaude
andcommitted
ci: format-check the example project
The root job's `mix format` only covers config/lib/test, so example scripts drifted out of format unnoticed (global_demo.exs shipped unformatted in 0.5.0). Add a `format-example` job that checks out search_core alongside (the example depends on it as a sibling path), fetches the example's deps and runs `mix format --check-formatted` — no Postgres, no compile, just formatting. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b8e372a commit 0378ece

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,39 @@ jobs:
6363

6464
- name: Test
6565
run: mix test
66+
67+
# The example is a separate mix project (own deps + formatter config) and the root job's
68+
# `mix format` only covers config/lib/test, so example scripts could drift out of format
69+
# unnoticed. It depends on search_core as a sibling path, so check it out alongside; format
70+
# only needs deps *fetched* (for import_deps), not compiled, so no Postgres and no test run.
71+
format-example:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v4
75+
with:
76+
path: search_ash
77+
78+
- uses: actions/checkout@v4
79+
with:
80+
repository: nseaSeb/search_core
81+
path: search_core
82+
83+
- uses: erlef/setup-beam@v1
84+
with:
85+
elixir-version: "1.19"
86+
otp-version: "28"
87+
88+
- name: Cache example deps
89+
uses: actions/cache@v4
90+
with:
91+
path: |
92+
search_ash/examples/search_demo/deps
93+
search_ash/examples/search_demo/_build
94+
key: ${{ runner.os }}-example-${{ hashFiles('search_ash/examples/search_demo/mix.lock') }}
95+
restore-keys: ${{ runner.os }}-example-
96+
97+
- name: Check example formatting
98+
working-directory: search_ash/examples/search_demo
99+
run: |
100+
mix deps.get
101+
mix format --check-formatted

0 commit comments

Comments
 (0)