-
Notifications
You must be signed in to change notification settings - Fork 4
37 lines (36 loc) · 1.68 KB
/
Copy pathtest-pre-commit.yml
File metadata and controls
37 lines (36 loc) · 1.68 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
name: pre-commit-hook-test
on:
pull_request: null
push:
branches:
- develop
jobs:
test-hooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Configure git safedir properly
run: git config --global --add safe.directory "$(pwd)"
- name: Fake update file
run: git mv tests/python_simple.py python_simple.py
- name: Set up uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-dependency-glob: .pre-commit-config.yaml
version: "0.11.x"
- name: Cache pre-commit hook envs
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/pre-commit
key: pre-commit-v1|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: UV_EXCLUDE_NEWER="1 week" uv tool install pre-commit --with pre-commit-uv
- name: Test semgrep pre-commit hook
run: pre-commit run --show-diff-on-failure --color=always semgrep --hook-stage manual --files python_simple.py
- name: Test semgrep-ci pre-commit hook
run: pre-commit run --show-diff-on-failure --color=always semgrep-ci --hook-stage manual --files python_simple.py
- name: Test semgrep-docker-develop pre-commit hook
run: pre-commit run --show-diff-on-failure --color=always semgrep-docker-develop --hook-stage manual --files python_simple.py
- name: Test semgrep-docker pre-commit hook
run: pre-commit run --show-diff-on-failure --color=always semgrep-docker --hook-stage manual --files python_simple.py