-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 975 Bytes
/
Copy pathpre-commit-warmup.yaml
File metadata and controls
38 lines (31 loc) · 975 Bytes
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
name: Pre-commit Cache Warm-up
on:
push:
branches:
- master
paths:
- .pre-commit-config.yaml
workflow_dispatch:
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
warm-precommit-cache:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pre-commit
run: pip install --no-cache-dir pre-commit
- name: Cache pre-commit
id: precommit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ runner.os }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Warm up hook environments
if: steps.precommit.outputs.cache-hit != 'true'
run: pre-commit install-hooks