make nesting checks more robust and more informative #1129
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Style-Enforcer | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- '*' | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths-ignore: | |
- 'README.md' | |
- '.gitignore' | |
jobs: | |
format-check: | |
name: Julia | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: julia-actions/setup-julia@v2 | |
with: | |
version: "1" | |
- uses: julia-actions/cache@v2 | |
- name: Install JuliaFormatter | |
shell: julia --project=@format --color=yes {0} | |
run: | | |
using Pkg | |
Pkg.add(PackageSpec(; name="JuliaFormatter", version="1")) | |
- name: Check formatting | |
shell: julia --project=@format --color=yes {0} | |
run: | | |
using JuliaFormatter | |
paths = ["docs", "src"] | |
isdir("ext") && push!(paths, "ext") | |
format(paths; verbose=true) || exit(1) | |
# Add formatting suggestions to non-draft PRs when "Check formatting" fails | |
- uses: reviewdog/action-suggester@v1 | |
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.draft == false }} | |
with: | |
tool_name: JuliaFormatter |