Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Next major release #3552

Merged
merged 8 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/matchers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "tflint-compact",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(Error|Warning|Notice)\\s-\\s(.+)\\s\\((.+)\\)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
"code": 6
}
]
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/packer-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
image: index.docker.io/hashicorp/packer@sha256:297bbbbbbf3ce9e0431ac1e8f02934b20e1197613f877b55dfdb1ebfd94eb748 # ratchet:index.docker.io/hashicorp/packer:1.8.6
strategy:
matrix:
image: ["linux-amzn2", "windows-core-2019", "windows-core-2022", "ubuntu-focal", "ubuntu-jammy", "ubuntu-jammy-arm64"]
image: ["linux-al2023", "windows-core-2019", "windows-core-2022", "ubuntu-focal", "ubuntu-jammy", "ubuntu-jammy-arm64"]
defaults:
run:
working-directory: images/${{ matrix.image }}
Expand Down
79 changes: 67 additions & 12 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,38 @@ jobs:
continue-on-error: true
- name: validate terraform
run: terraform validate
- if: contains(matrix.terraform, '1.3.')
name: Fix for actions/cache on alpine
run: apk add --no-cache tar
continue-on-error: true
- if: contains(matrix.terraform, '1.3.')
uses: actions/cache@v3.3.1
name: Cache TFLint plugin dir
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.tflint.hcl') }}
- if: contains(matrix.terraform, '1.3.')
name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- if: contains(matrix.terraform, '1.3.')
name: Run TFLint
run: tflint -f compact
run: |
tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl
tflint -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars

verify_examples:
name: Verify examples
verify_modules:
name: Verify modules
strategy:
fail-fast: false
matrix:
terraform: [1.3.0, "latest"]
example:
["default", "ubuntu", "prebuilt", "arm64", "ephemeral", "windows"]
terraform: [1.3.2, "latest"]
module:
["download-lambda", "multi-runner", "runner-binaries-syncer", "runners", "setup-iam-permissions", "ssm", "webhook"]
defaults:
run:
working-directory: examples/${{ matrix.example }}
working-directory: modules/${{ matrix.module }}
runs-on: ubuntu-latest
container:
image: hashicorp/terraform:${{ matrix.terraform }}
Expand All @@ -75,19 +87,41 @@ jobs:
name: check terraform formatting
run: terraform fmt -recursive -check=true -write=false
continue-on-error: true
- name: validate terraform011
- name: validate terraform
run: terraform validate
- if: contains(matrix.terraform, '1.3.')
name: Fix for actions/cache on alpine
run: apk add --no-cache tar
continue-on-error: true
- if: contains(matrix.terraform, '1.3.')
uses: actions/cache@v3.3.1
name: Cache TFLint plugin dir
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.tflint.hcl') }}
- if: contains(matrix.terraform, '1.3.')
name: Setup TFLint
uses: terraform-linters/setup-tflint@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- if: contains(matrix.terraform, '1.3.')
name: Run TFLint
working-directory: ${{ github.workspace }}
run: |
tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl --chdir modules/${{ matrix.module }}
tflint -f compact -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars --chdir modules/${{ matrix.module }}


verify_multi_runner_example:
name: Verify Multi-Runner examples
verify_examples:
name: Verify examples
strategy:
fail-fast: false
matrix:
terraform: [1.3.2, "latest"]
example:
["default", "ubuntu", "prebuilt", "arm64", "ephemeral", "windows", "multi-runner"]
defaults:
run:
working-directory: examples/multi-runner
working-directory: examples/${{ matrix.example }}
runs-on: ubuntu-latest
container:
image: hashicorp/terraform:${{ matrix.terraform }}
Expand All @@ -104,4 +138,25 @@ jobs:
continue-on-error: true
- name: validate terraform
run: terraform validate
- if: contains(matrix.terraform, '1.3.')
name: Fix for actions/cache on alpine
run: apk add --no-cache tar
continue-on-error: true
- if: contains(matrix.terraform, '1.3.')
uses: actions/cache@v3.3.1
name: Cache TFLint plugin dir
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.tflint.hcl') }}
- if: contains(matrix.terraform, '1.3.')
name: Setup TFLint
uses: terraform-linters/setup-tflint@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- if: contains(matrix.terraform, '1.3.')
name: Run TFLint
working-directory: ${{ github.workspace }}
run: |
tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl --chdir modules/${{ matrix.module }}
tflint -f compact -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars --chdir examples/${{ matrix.example }}

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ secrets.auto.tfvars
**/coverage/*

node_modules/

6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.1
rev: v1.83.5
hooks:
- id: terraform_fmt
- id: terraform_tflint
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl --var-file __GIT_WORKING_DIR__/.github/lint/tflint.tfvars
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
19 changes: 18 additions & 1 deletion .tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ config {
format = "compact"
module = true

varfile = [".github/lint/tflint.tfvars"]

}

plugin "aws" {
enabled = true
version = "0.23.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}

rule "terraform_comment_syntax" {
enabled = true
}

rule "terraform_naming_convention" {
enabled = true
}

rule "terraform_documented_variables" {
enabled = true
}
Loading
Loading