Skip to content

Commit 4a81e00

Browse files
huiyuxieranochaHuiyu Xiesloede
authored
Add format suggestions to CI (trixi-framework#2118)
* Start * Update .github/workflows/FormatCheck.yml Co-authored-by: Hendrik Ranocha <[email protected]> * Update .github/workflows/FormatCheck.yml Co-authored-by: Hendrik Ranocha <[email protected]> * Update .github/workflows/FormatCheck.yml Co-authored-by: Hendrik Ranocha <[email protected]> * Fix * Sample * Revert * Revert --------- Co-authored-by: Hendrik Ranocha <[email protected]> Co-authored-by: Huiyu Xie <[email protected]> Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
1 parent 54237d3 commit 4a81e00

File tree

1 file changed

+6
-33
lines changed

1 file changed

+6
-33
lines changed

.github/workflows/FormatCheck.yml

+6-33
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: format-check
1+
name: Format suggestions
22

33
on:
44
push:
@@ -8,37 +8,10 @@ on:
88
pull_request:
99

1010
jobs:
11-
check-format:
12-
runs-on: ${{ matrix.os }}
13-
strategy:
14-
matrix:
15-
julia-version: [1]
16-
julia-arch: [x86]
17-
os: [ubuntu-latest]
11+
format-suggestions:
12+
runs-on: ubuntu-latest
1813
steps:
19-
- uses: julia-actions/setup-julia@latest
20-
with:
21-
version: ${{ matrix.julia-version }}
22-
2314
- uses: actions/checkout@v4
24-
- name: Install JuliaFormatter and format
25-
# This will use the latest version by default but you can set the version like so:
26-
#
27-
# julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version = "0.13.0"))'
28-
#
29-
# TODO: Change the call below to
30-
# format(".")
31-
run: |
32-
julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.60"))'
33-
julia -e 'using JuliaFormatter; format(["benchmark", "examples", "ext", "src", "test", "utils"])'
34-
- name: Format check
35-
run: |
36-
julia -e '
37-
out = Cmd(`git diff --name-only`) |> read |> String
38-
if out == ""
39-
exit(0)
40-
else
41-
@error "Some files have not been formatted !!!"
42-
write(stdout, out)
43-
exit(1)
44-
end'
15+
- uses: julia-actions/julia-format@v3
16+
with:
17+
version: "1.0.60"

0 commit comments

Comments
 (0)