Skip to content

Merge pull request #59 from bauglir/improve-release-workflow #129

Merge pull request #59 from bauglir/improve-release-workflow

Merge pull request #59 from bauglir/improve-release-workflow #129

---
name: Code Format Check
on:
pull_request:
push:
branches:
- development
jobs:
code-format-check:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@v1
with:
version: '1.10'
- uses: actions/checkout@v4
- name: Install JuliaFormatter and format
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="1.0.53"))'
julia -e 'using JuliaFormatter; format("."; indent = 2, remove_extra_newlines = true, verbose = true, whitespace_typedefs = true, whitespace_ops_in_indices = true)'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted properly!"
write(stdout, out)
exit(1)
end'