Skip to content

Commit

Permalink
Add formatting action
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenJ committed Apr 11, 2024
1 parent 1abf9c4 commit c9e8f52
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/JuliaFormatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Formatting Check

on:
push:
branches:
- master
tags: '*'
pull_request:

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
format:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/[email protected]

- uses: dorny/[email protected]
id: filter
with:
filters: |
julia_file_change:
- added|modified: '**.jl'
- uses: julia-actions/setup-julia@latest
if: steps.filter.outputs.julia_file_change == 'true'
with:
version: ${{ matrix.version }}

- name: Apply JuliaFormatter
if: steps.filter.outputs.julia_file_change == 'true'
run: |
julia --color=yes .dev/herb_format.jl --verbose .
- name: Check formatting diff
if: steps.filter.outputs.julia_file_change == 'true'
run: |
git diff --color=always --exit-code

0 comments on commit c9e8f52

Please sign in to comment.