|
| 1 | +name: pre-commit-hook-test |
| 2 | +on: |
| 3 | + pull_request: null |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + |
1 | 8 | jobs: |
2 | 9 | test-hooks: |
3 | 10 | runs-on: ubuntu-latest |
|
7 | 14 | run: git config --global --add safe.directory "$(pwd)" |
8 | 15 | - name: Fake update file |
9 | 16 | run: git mv tests/python_simple.py python_simple.py |
10 | | - - name: Test semgrep pre-commit hook |
11 | | - uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0 |
| 17 | + - name: Set up uv |
| 18 | + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 |
12 | 19 | with: |
13 | | - extra_args: semgrep --hook-stage manual --files python_simple.py |
14 | | - - name: Test semgrep-ci pre-commit hook |
15 | | - uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0 |
| 20 | + enable-cache: true |
| 21 | + cache-dependency-glob: .pre-commit-config.yaml |
| 22 | + version: "0.11.x" |
| 23 | + - name: Cache pre-commit hook envs |
| 24 | + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
16 | 25 | with: |
17 | | - extra_args: semgrep-ci --hook-stage manual --files python_simple.py |
| 26 | + path: ~/.cache/pre-commit |
| 27 | + key: pre-commit-v1|${{ hashFiles('.pre-commit-config.yaml') }} |
| 28 | + - name: Install pre-commit |
| 29 | + run: UV_EXCLUDE_NEWER="1 week" uv tool install pre-commit --with pre-commit-uv |
| 30 | + - name: Test semgrep pre-commit hook |
| 31 | + run: pre-commit run --show-diff-on-failure --color=always semgrep --hook-stage manual --files python_simple.py |
| 32 | + - name: Test semgrep-ci pre-commit hook |
| 33 | + run: pre-commit run --show-diff-on-failure --color=always semgrep-ci --hook-stage manual --files python_simple.py |
18 | 34 | - name: Test semgrep-docker-develop pre-commit hook |
19 | | - uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0 |
20 | | - with: |
21 | | - extra_args: semgrep-docker-develop --hook-stage manual --files python_simple.py |
| 35 | + run: pre-commit run --show-diff-on-failure --color=always semgrep-docker-develop --hook-stage manual --files python_simple.py |
22 | 36 | - name: Test semgrep-docker pre-commit hook |
23 | | - uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0 |
24 | | - with: |
25 | | - extra_args: semgrep-docker --hook-stage manual --files python_simple.py |
26 | | - |
27 | | -name: pre-commit-hook-test |
28 | | -on: |
29 | | - pull_request: null |
30 | | - push: |
31 | | - branches: |
32 | | - - develop |
| 37 | + run: pre-commit run --show-diff-on-failure --color=always semgrep-docker --hook-stage manual --files python_simple.py |
0 commit comments