Skip to content

Commit

Permalink
Add formatter GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Jan 18, 2024
1 parent e4168f3 commit 74376a3
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/julia_formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: JuliaFormatter

on:
push:
branches:
- main
tags: '*'
pull_request:
merge_group:

jobs:
format:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- 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: 1.10

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

0 comments on commit 74376a3

Please sign in to comment.