diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml new file mode 100644 index 0000000..e576a1b --- /dev/null +++ b/.github/workflows/FormatCheck.yml @@ -0,0 +1,34 @@ +name: Format Check + +on: + push: + branches: + - 'main' + - 'release-' + tags: '*' + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: julia-actions/setup-julia@latest + with: + version: 1 + - uses: actions/checkout@v1 + - name: Install JuliaFormatter + run: | + using Pkg + Pkg.add("JuliaFormatter") + shell: julia --color=yes {0} + - name: Format code + run: | + using JuliaFormatter + format("."; verbose=true) + shell: julia --color=yes {0} + - name: Suggest formatting changes + uses: reviewdog/action-suggester@v1 + if: github.event_name == 'pull_request' + with: + tool_name: JuliaFormatter + fail_on_error: true \ No newline at end of file