Format Julia code on 'main' #720
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: Format Julia code on 'main' | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: '1.10' | |
| - uses: julia-actions/cache@v3 | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: main | |
| - name: Install JuliaFormatter.jl | |
| shell: julia --color=yes {0} | |
| run: | | |
| import Pkg | |
| Pkg.add(; name="JuliaFormatter", version="1") | |
| - name: Format code | |
| shell: julia --color=yes {0} | |
| run: | | |
| using JuliaFormatter | |
| format(".") | |
| - name: Create Pull Request | |
| id: cpr | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: Format Julia code | |
| title: 'Format Julia code of branch "main"' | |
| branch: format-main-julia | |
| delete-branch: true | |
| labels: format | |
| author: enzyme-ci-bot[bot] <78882869+enzyme-ci-bot[bot]@users.noreply.github.com> | |
| - name: Check outputs | |
| run: | | |
| echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
| echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |