Skip to content

Commit 8b0b287

Browse files
committed
fix: Update Lint CI to work with new precommits and repo structure
1 parent 654f026 commit 8b0b287

2 files changed

Lines changed: 6 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ on:
1010
workflow_dispatch:
1111

1212
env:
13+
CARGO_TERM_COLOR: always
1314
# Cache version to control pre-commit caches
1415
CACHE_VERSION: 0
15-
# 3.9 is recent enough
16-
DEFAULT_PYTHON: 3.10.11
1716
# Location of the pre-commit cache. This is set by pre-commit, not us!
1817
PRE_COMMIT_CACHE: ~/.cache/pre-commit
1918

@@ -33,36 +32,6 @@ jobs:
3332

3433
- name: Setup Python
3534
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
6635

6736
- name: Install hadolint
6837
run: >
@@ -72,10 +41,9 @@ jobs:
7241
7342
sudo chmod +x /bin/hadolint
7443
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+
7947
build:
8048
name: Build Image
8149
needs: lint

.pre-commit-config.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
---
2-
default_language_version:
3-
python: python3.10
4-
52
repos:
63
- repo: https://github.com/adrienverge/yamllint.git
74
rev: v1.33.0
@@ -24,7 +21,7 @@ repos:
2421
- --quiet-level=2
2522
exclude_types: [csv, json]
2623
- repo: https://github.com/hadolint/hadolint
27-
rev: v2.12.1-beta
24+
rev: v2.14.0
2825
hooks:
2926
- id: hadolint
3027
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -42,4 +39,4 @@ repos:
4239
- id: trailing-whitespace
4340
- id: no-commit-to-branch
4441
args:
45-
- --branch=master
42+
- --branch=main

0 commit comments

Comments
 (0)