-
Notifications
You must be signed in to change notification settings - Fork 82
45 lines (35 loc) · 1.12 KB
/
PreCommit.yml
File metadata and controls
45 lines (35 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# This workflow runs pre-commit on the JuliaFormatter repo itself, i.e.,
# checks that this repo is formatted.
name: Pre-Commit
# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read
on:
push:
branches:
- master
tags: ['*']
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v6
# Note: Pkg App support only in >= 1.12
- uses: julia-actions/setup-julia@v3
- uses: julia-actions/cache@v3
- name: Install local JuliaFormatter as Pkg app
run: julia --project -e 'using Pkg; Pkg.instantiate(); Pkg.Apps.develop(; path=pwd())'
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Run pre-commit hooks
run: |
export PATH=$PATH:${HOME}/.julia/bin/
pipx run pre-commit run --all-files --show-diff-on-failure --color always