-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (50 loc) · 1.41 KB
/
enforce-pre-commit.yml
File metadata and controls
55 lines (50 loc) · 1.41 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
46
47
48
49
50
51
52
53
54
55
name: Enforce Pre-Commit Hooks
on:
push:
branches:
- "main"
pull_request:
types: [opened, synchronize, reopened]
workflow_call:
inputs:
ref:
required: true
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-enforce-pre-commit
cancel-in-progress: true
jobs:
enforce-pre-commit:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout streamlit-pivot-table code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
submodules: "recursive"
fetch-depth: 2
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Restore pre-commit cache
id: cache-pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: v1-pre-commit-${{ env.pythonLocation }}-${{ hashFiles('**/.pre-commit-config.yaml') }}
- name: Install pre-commit
run: |
pip install pre-commit
pre-commit install-hooks
shell: bash
- name: Install frontend dependencies for prettier
run: |
cd streamlit_pivot/frontend
npm ci
- name: Run pre-commit hooks
run: PRE_COMMIT_NO_CONCURRENCY=true pre-commit run --show-diff-on-failure --color=always --all-files