|
6 | 6 | - cron: '0 18 * * SUN'
|
7 | 7 |
|
8 | 8 | jobs:
|
9 |
| - lint: |
10 |
| - name: Terraform validate ${{ matrix.terraform_version }} |
| 9 | + pre-commit: |
| 10 | + name: Pre-commit checks |
11 | 11 | 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 | 12 | 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 |
38 | 15 |
|
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' |
66 | 20 |
|
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' |
70 | 25 |
|
71 |
| - - name: Set up Python version |
72 |
| - uses: actions/setup-python@v2 |
| 26 | + - name: Install TFLint |
| 27 | + uses: terraform-linters/setup-tflint@v4 |
73 | 28 | with:
|
74 |
| - python-version: ${{ matrix.config.python-version }} |
| 29 | + tflint_version: v0.58.0 |
75 | 30 |
|
76 | 31 | - 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 |
78 | 35 |
|
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