Skip to content

Commit bca7438

Browse files
authored
Merge pull request #111 from EnzymeAD/ap/format_ci
ci(github-actions): update the formatter action
2 parents 88dd99a + 43df7ba commit bca7438

File tree

2 files changed

+4
-29
lines changed

2 files changed

+4
-29
lines changed

.github/workflows/format-check.yml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check format
1+
name: Format Suggestions
22
on:
33
push:
44
branches:
@@ -7,32 +7,7 @@ on:
77
pull_request:
88

99
jobs:
10-
format:
10+
code-style:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: dorny/[email protected]
15-
id: filter
16-
with:
17-
filters: |
18-
julia_file_change:
19-
- added|modified: '**.jl'
20-
- uses: julia-actions/setup-julia@latest
21-
if: steps.filter.outputs.julia_file_change == 'true'
22-
with:
23-
version: 1.10
24-
- name: Install JuliaFormatter.jl
25-
run: julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
26-
- name: Format code
27-
run: julia -e 'using JuliaFormatter; format(["src", "ext", "test"], verbose=true)'
28-
- name: Format check
29-
run: |
30-
julia -e '
31-
out = Cmd(`git diff --name-only`) |> read |> String
32-
if out == ""
33-
exit(0)
34-
else
35-
@error "Some files have not been formatted !!!"
36-
write(stdout, out)
37-
exit(1)
38-
end'
13+
- uses: julia-actions/julia-format@v3

.github/workflows/format-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
shell: julia --color=yes {0}
2727
run: |
2828
using JuliaFormatter
29-
format(["src", "ext", "test"])
29+
format(".")
3030
- name: Create Pull Request
3131
id: cpr
3232
uses: peter-evans/create-pull-request@v6

0 commit comments

Comments
 (0)