Skip to content

Commit 36bcce4

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 c41127c commit 36bcce4

File tree

1 file changed

+16
-66
lines changed

1 file changed

+16
-66
lines changed

.github/workflows/CI.yml

Lines changed: 16 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -6,77 +6,27 @@ 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
19-
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
38-
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
66-
6712
steps:
6813
- name: Checkout repository
69-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.13'
7020

71-
- name: Set up Python version
72-
uses: actions/setup-python@v2
21+
- name: Install Terraform
22+
uses: hashicorp/setup-terraform@v3
7323
with:
74-
python-version: ${{ matrix.config.python-version }}
24+
terraform_version: 'latest'
7525

7626
- name: Install dependencies
77-
run: python -m pip install tox==3.20.0
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements-dev.txt
7830
79-
- name: Python test
80-
run: tox
81-
env:
82-
TOXENV: "${{ matrix.config.toxenv }}"
31+
- name: Run pre-commit
32+
uses: pre-commit/action@v3.0.1

0 commit comments

Comments
 (0)