-
Notifications
You must be signed in to change notification settings - Fork 69
44 lines (40 loc) · 1.21 KB
/
FormatCheck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: format-check
on:
push:
branches:
- "master"
- "release-*" # Match release branches
tags: "*" # Trigger on tag pushes
pull_request: # Trigger on pull requests
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1] # Julia versions
julia-arch: [x86] # Architectures
os: [ubuntu-latest] # OS
steps:
# Step 1: Set up Julia
- name: Set up Julia
uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
# Step 2: Check out code
- name: Checkout code
uses: actions/checkout@v4
# Step 3: Install JuliaFormatter and check formatting
- name: Install JuliaFormatter and check formatting
run: |
julia -e '
using Pkg;
Pkg.add(PackageSpec(name="JuliaFormatter"));
using JuliaFormatter;
result = format(".", verbose=true)
if !result
error("Some files are not properly formatted. Please run `using JuliaFormatter; format(\".\")` locally.")
else
println("All files are properly formatted.")
end
'