Skip to content

Bump julia-actions/cache from 2 to 3 (#247) #81

Bump julia-actions/cache from 2 to 3 (#247)

Bump julia-actions/cache from 2 to 3 (#247) #81

Workflow file for this run

name: Code checks
on:
pull_request:
push:
branches: ["main"]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
format:
runs-on: ubuntu-latest
name: "JuliaFormatter.jl"
steps:
- uses: julia-actions/setup-julia@latest
with:
version: '1.12'
- uses: actions/checkout@v6
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter")); Pkg.Apps.add(PackageSpec(name="JuliaFormatter"))'
$HOME/.julia/bin/jlfmt --inplace -v .
- name: Format check
run: |
julia -e '
out = Cmd(`git diff`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'