Skip to content

Commit

Permalink
adds format check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinKaisermayer committed Dec 18, 2024
1 parent c5fd57c commit 75d2263
Show file tree
Hide file tree
Showing 47 changed files with 3,352 additions and 3,230 deletions.
2 changes: 0 additions & 2 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
style = "blue"
format_markdown = true
format_docstrings = true
10 changes: 5 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
fail-fast: false
matrix:
version:
- "1.6.7" # LTS
- "1.6.7" # LTS
- "1.6"
- "1" # Latest Release
- "1" # Latest Release
os:
- ubuntu-latest
arch:
- x64

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
Expand Down Expand Up @@ -53,10 +53,10 @@ jobs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: '1'
version: "1"
- run: |
git config --global user.name name
git config --global user.email email
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/DocCleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Delete preview and history
run: |
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
env:
PRNUM: ${{ github.event.number }}
PRNUM: ${{ github.event.number }}

- name: Push changes
run: |
git push --force origin gh-pages-new:gh-pages
git push --force origin gh-pages-new:gh-pages
31 changes: 0 additions & 31 deletions .github/workflows/Format.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
'
Loading

0 comments on commit 75d2263

Please sign in to comment.