-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.24 KB
/
pre-commit.yaml
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
46
47
48
49
50
51
52
name: pre-commit
permissions:
contents: read
on:
workflow_dispatch:
pull_request:
branches:
- main
- master
jobs:
pre-commit:
runs-on: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Cache ASDF
uses: actions/cache@v4
id: asdf-cache
with:
path: ~/.asdf/
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
restore-keys: ${{ runner.os }}-asdf-
- name: Setup ASDF
uses: asdf-vm/actions/setup@v3
if: ${{ steps.asdf-cache.outputs.cache-hit == 'true' }}
- name: Install ASDF
uses: asdf-vm/actions/install@v3
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}
- name: Reshim installed ASDF tools
shell: bash
run: asdf reshim
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install pip dependencies
run: pip install -r requirements.txt
- uses: pre-commit/[email protected]