Skip to content

Commit

Permalink
Add formatting action.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Jan 8, 2025
1 parent a94e6e2 commit 6e2554c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/Format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: 'Format'

on:
pull_request:
paths: ['**/*.jl']
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

# needed for julia-actions/cache to delete old caches
actions: write

# needed for parkerbxyz/suggest-changes
pull-requests: write

jobs:
runic:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Julia
uses: julia-actions/setup-julia@v2
with:
version: '1'
arch: 'x64'
- uses: julia-actions/cache@v2

- name: Install Runic
run: |
julia --project=@runic -e 'using Pkg; Pkg.add("Runic")'
curl -o git-runic https://raw.githubusercontent.com/fredrikekre/Runic.jl/master/bin/git-runic
chmod +x git-runic
- name: Run Runic
run: |
set +e
./git-runic origin/master
[ $? -eq 2 ] && exit 1 || exit 0
- name: Suggest changes
uses: parkerbxyz/suggest-changes@v1
with:
comment: 'Runic suggested the following formatting changes.'
event: 'COMMENT'

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml → .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Test

on:
push:
Expand Down

0 comments on commit 6e2554c

Please sign in to comment.