Skip to content

Commit

Permalink
ci: add tflint job
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtoj committed Aug 11, 2023
1 parent 7f481d5 commit 83a2cd9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ RUN SYSTEM_ARCH=$(dpkg --print-architecture) \
&& terraform version \
&& rm terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip

# install tflint
RUN curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash

# install docker
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: test

on:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Terraform Setup
run: |
terraform init
- name: Lint Terraform
uses: reviewdog/action-tflint@master
with:
github_token: ${{ secrets.github_token }}
filter_mode: "nofilter"
12 changes: 12 additions & 0 deletions version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@ terraform {
required_version = ">= 0.13.0"

required_providers {
archive = {
source = "hashicorp/archive"
version = ">= 2.4.0"
}
docker = {
source = "kreuzwerker/docker"
version = ">= 3.0.0, < 4.0.0"
}
null = {
source = "hashicorp/null"
version = ">= 3.2.1"
}
random = {
source = "hashicorp/random"
version = ">= 3.5.1"
}
}
}

0 comments on commit 83a2cd9

Please sign in to comment.