|
10 | 10 | workflow_dispatch: |
11 | 11 |
|
12 | 12 | env: |
| 13 | + CARGO_TERM_COLOR: always |
13 | 14 | # Cache version to control pre-commit caches |
14 | 15 | CACHE_VERSION: 0 |
15 | | - # 3.9 is recent enough |
16 | | - DEFAULT_PYTHON: 3.10.11 |
17 | 16 | # Location of the pre-commit cache. This is set by pre-commit, not us! |
18 | 17 | PRE_COMMIT_CACHE: ~/.cache/pre-commit |
19 | 18 |
|
|
33 | 32 |
|
34 | 33 | - name: Setup Python |
35 | 34 | uses: actions/setup-python@v5.6.0 |
36 | | - with: |
37 | | - python-version: ${{ env.DEFAULT_PYTHON}} |
38 | | - cache: "pip" |
39 | | - |
40 | | - - name: Generate pre-commit cache key |
41 | | - id: pre-commit_cache_key |
42 | | - run: > |
43 | | - echo "::set-output |
44 | | - name=key::${{ env.CACHE_VERSION }}-${{ env.DEFAULT_PYTHON }}-${{ |
45 | | - hashFiles('.pre-commit-config.yaml') }}" |
46 | | -
|
47 | | - - name: Install pre-commit |
48 | | - run: | |
49 | | - pip install --upgrade pip |
50 | | - pip install "$(cat requirements_test.txt | grep pre-commit)" |
51 | | -
|
52 | | - - name: Restore base pre-commit environment |
53 | | - id: cache-pre-commmit |
54 | | - uses: actions/cache@v4.2.0 |
55 | | - with: |
56 | | - path: ${{ env.PRE_COMMIT_CACHE }} |
57 | | - key: > |
58 | | - ${{ runner.os |
59 | | - }}-pre-commit-${{ |
60 | | - steps.pre-commit_cache_key.outputs.key }} |
61 | | -
|
62 | | - - name: Install pre-commit dependencies if no cache |
63 | | - if: steps.cache-pre-commit.outputs.cache-hit != 'true' |
64 | | - run: | |
65 | | - pre-commit install-hooks |
66 | 35 |
|
67 | 36 | - name: Install hadolint |
68 | 37 | run: > |
|
72 | 41 |
|
73 | 42 | sudo chmod +x /bin/hadolint |
74 | 43 |
|
75 | | - - name: Run hooks |
76 | | - run: > |
77 | | - SKIP=no-commit-to-branch |
78 | | - pre-commit run --all-files --show-diff-on-failure |
| 44 | + - name: Setup precommit |
| 45 | + uses: pre-commit/action@v3.0.1 |
| 46 | + |
79 | 47 | build: |
80 | 48 | name: Build Image |
81 | 49 | needs: lint |
|
0 commit comments