Skip to content

Commit 0539328

Browse files
committed
ci(github-actions): migrate from tox to pre-commit
Simplified CI workflow by replacing multiple tox-based jobs with a single pre-commit job that runs all quality checks (Terraform linting, Python formatting, unit tests) through unified tooling. This reduces complexity and maintains consistency with local development workflow.
1 parent 1cf719a commit 0539328

File tree

1 file changed

+20
-65
lines changed

1 file changed

+20
-65
lines changed

.github/workflows/CI.yml

Lines changed: 20 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -6,77 +6,32 @@ on:
66
- cron: '0 18 * * SUN'
77

88
jobs:
9-
lint:
10-
name: Terraform validate ${{ matrix.terraform_version }}
9+
pre-commit:
10+
name: Pre-commit checks
1111
runs-on: ubuntu-latest
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
terraform_version:
16-
- latest
17-
- 1.2.9
18-
- 1.1.9
1912
steps:
20-
- uses: actions/checkout@master
21-
- uses: hashicorp/setup-terraform@v2
22-
with:
23-
terraform_version: "${{ matrix.terraform_version }}"
24-
25-
- name: Terraform version
26-
id: version
27-
run: terraform version
28-
- name: Terraform fmt
29-
id: fmt
30-
run: terraform fmt -check
31-
continue-on-error: true
32-
- name: Terraform init
33-
id: init
34-
run: terraform init
35-
- name: Terraform Validate
36-
id: validate
37-
run: terraform validate -no-color
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
3815

39-
pythontest:
40-
name: ${{ matrix.config.toxenv }}
41-
runs-on: ubuntu-latest
42-
strategy:
43-
fail-fast: false
44-
matrix:
45-
config:
46-
- toxenv: py37
47-
python-version: 3.7
48-
- toxenv: py38
49-
python-version: 3.8
50-
- toxenv: py39
51-
python-version: 3.9
52-
- toxenv: py310
53-
python-version: '3.10'
54-
# - toxenv: py311
55-
# python-version: 3.11
56-
- toxenv: flake8
57-
python-version: 3.8
58-
- toxenv: pylint
59-
python-version: 3.8
60-
- toxenv: black
61-
python-version: 3.8
62-
- toxenv: mypy
63-
python-version: 3.8
64-
- toxenv: pytest
65-
python-version: 3.8
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.13'
6620

67-
steps:
68-
- name: Checkout repository
69-
uses: actions/checkout@v2
21+
- name: Install Terraform
22+
uses: hashicorp/setup-terraform@v3
23+
with:
24+
terraform_version: 'latest'
7025

71-
- name: Set up Python version
72-
uses: actions/setup-python@v2
26+
- name: Install TFLint
27+
uses: terraform-linters/setup-tflint@v4
7328
with:
74-
python-version: ${{ matrix.config.python-version }}
29+
tflint_version: v0.58.0
7530

7631
- name: Install dependencies
77-
run: python -m pip install tox==3.20.0
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install -r requirements-dev.txt
7835
79-
- name: Python test
80-
run: tox
81-
env:
82-
TOXENV: "${{ matrix.config.toxenv }}"
36+
- name: Run pre-commit
37+
uses: pre-commit/[email protected]

0 commit comments

Comments
 (0)