File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : format-check
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+ push :
8
+ branches :
9
+ - main
10
+ tags : ' *'
11
+
12
+ jobs :
13
+ build :
14
+ runs-on : ${{ matrix.os }}
15
+ strategy :
16
+ matrix :
17
+ julia-version : [1]
18
+ julia-arch : [x86]
19
+ os : [ubuntu-latest]
20
+ steps :
21
+ - uses : julia-actions/setup-julia@latest
22
+ with :
23
+ version : ${{ matrix.julia-version }}
24
+
25
+ - uses : actions/checkout@v1
26
+ - name : Install JuliaFormatter and format
27
+ # This will use the latest version by default but you can set the version like so:
28
+ #
29
+ # julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
30
+ run : |
31
+ julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
32
+ julia -e 'using JuliaFormatter; format(".", verbose=true)'
33
+ - name : Format check
34
+ run : |
35
+ julia -e '
36
+ out = Cmd(`git diff`) |> read |> String
37
+ if out == ""
38
+ exit(0)
39
+ else
40
+ @error "Some files have not been formatted !!!"
41
+ write(stdout, out)
42
+ exit(1)
43
+ end'
You can’t perform that action at this time.
0 commit comments