Skip to content

Commit 0419d4e

Browse files
Add formatting check to CI (#565)
1 parent 7a213ac commit 0419d4e

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

.formatter.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ locals_without_parens = [
3131
export: [
3232
locals_without_parens: locals_without_parens
3333
],
34-
inputs: []
34+
inputs: ["{lib,test}/**/*.{ex,exs}"]
3535
]

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ jobs:
88
fail-fast: false
99
matrix:
1010
elixirbase:
11-
- "1.13.4-erlang-24.3.4.2-alpine-3.16.0"
12-
- "1.13.4-erlang-22.3.4.20-alpine-3.14.0"
11+
- image: "1.13.4-erlang-24.3.4.2-alpine-3.16.0"
12+
lint: lint
13+
- image: "1.13.4-erlang-22.3.4.20-alpine-3.14.0"
1314
steps:
1415
- uses: earthly/actions-setup@v1
1516
- uses: actions/checkout@v3
1617
- name: test ecto_sql
17-
run: earthly -P --ci --build-arg ELIXIR_BASE=${{matrix.elixirbase}} +test
18+
run: earthly -P --ci --build-arg LINT=${{matrix.elixirbase.lint}} --build-arg ELIXIR_BASE=${{matrix.elixirbase.image}} +test
1819
test-postgres:
1920
name: postgres integration test
2021
runs-on: ubuntu-latest

Earthfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ test:
1717
RUN MIX_ENV=test mix deps.compile
1818
COPY --dir bench integration_test lib test ./
1919

20+
ARG LINT
21+
RUN if [ "$LINT" == "lint" ]; then mix format --check-formatted; fi
2022
RUN mix deps.get && mix deps.unlock --check-unused
2123
RUN mix deps.compile
2224
RUN mix compile #--warnings-as-errors

0 commit comments

Comments
 (0)