diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000..d953b67 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,3 @@ +self-hosted-runner: + labels: + - blacksmith-2vcpu-ubuntu-2404 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ce7be55 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + terraform: + name: Terraform lint and validate + runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 15 + env: + CHECKPOINT_DISABLE: "1" + TF_IN_AUTOMATION: "true" + TF_INPUT: "false" + steps: + - name: Check out repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up Terraform + uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1 + with: + terraform_version: 1.14.9 + terraform_wrapper: false + + - name: Set up TFLint + uses: terraform-linters/setup-tflint@6e1e0642c0289bd619021bf6b34e3c08ed1e005a # v6.3.0 + with: + cache: true + tflint_version: v0.64.0 + + - name: Check Terraform formatting + run: terraform fmt -check -recursive -diff + + - name: Initialize TFLint plugins + env: + GITHUB_TOKEN: ${{ github.token }} + run: tflint --init + + - name: Run TFLint + run: tflint --format compact + + - name: Initialize Terraform + run: terraform init -backend=false -input=false -no-color + + - name: Validate Terraform + run: terraform validate -no-color diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..fb062cc --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,28 @@ +name: Release Please + +on: + push: + branches: + - main + +permissions: + contents: write + issues: write + pull-requests: write + +concurrency: + group: release-please-${{ github.ref }} + cancel-in-progress: false + +jobs: + release-please: + name: Release Please + runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 10 + steps: + - name: Create or update release + uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..ca1c614 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.7.2" +} diff --git a/.tflint.hcl b/.tflint.hcl index 1283438..1305edb 100644 --- a/.tflint.hcl +++ b/.tflint.hcl @@ -5,8 +5,8 @@ config { # Enable all available rules by default - module = true - force = false + call_module_type = "local" + force = false } # ============================================================================= @@ -15,7 +15,7 @@ config { plugin "google" { enabled = true - version = "0.28.0" + version = "0.39.0" source = "github.com/terraform-linters/tflint-ruleset-google" } @@ -87,8 +87,8 @@ rule "terraform_required_version" { # Google Cloud Specific Rules # ============================================================================= -# Ensure GKE clusters use VPC-native networking -rule "google_container_cluster_node_pool" { +# Ensure GKE node pools use valid machine types +rule "google_container_node_pool_invalid_machine_type" { enabled = true } diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..31e0291 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/v17.6.0/schemas/config.json", + "packages": { + ".": { + "release-type": "terraform-module", + "include-component-in-tag": false, + "include-v-in-tag": true, + "include-v-in-release-name": true, + "exclude-paths": [ + ".github" + ] + } + } +}