diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 7287e89..7f8eea3 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -4,8 +4,6 @@ name: terraform on: push: -# branches: -# - master pull_request: jobs: @@ -14,67 +12,13 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 1 - name: terraform setup - uses: hashicorp/setup-terraform@v1 - # cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} - -# TODO: This step duplicates work done by the Makefile. -# - name: check terraform formatting -# id: fmt -# run: | -# terraform fmt -check -recursive + uses: hashicorp/setup-terraform@v3 - name: run make - # env: - # TOKEN: ${{ secrets.TOKEN }} run: | make all - -# - name: terraform init -# id: init -# run: terraform init -# -# - name: terraform plan -# id: plan -# if: github.event_name == 'pull_request' -# run: terraform plan -no-color -# continue-on-error: true -# -# - uses: actions/github-script@0.9.0 -# if: github.event_name == 'pull_request' -# env: -# PLAN: "terraform\n${{ steps.plan.outputs.stdout }}" -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} -# script: | -# const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` -# #### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\` -# #### Terraform Plan 📖\`${{ steps.plan.outcome }}\` -# -#
Show Plan -# -# \`\`\`${process.env.PLAN}\`\`\` -# -#
-# -# *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`; -# -# -# github.issues.createComment({ -# issue_number: context.issue.number, -# owner: context.repo.owner, -# repo: context.repo.repo, -# body: output -# }) -# -# - name: terraform plan status -# if: steps.plan.outcome == 'failure' -# run: exit 1 -# -# - name: terraform apply -# if: github.ref == 'refs/heads/master' && github.event_name == 'push' -# run: terraform apply -auto-approve diff --git a/Makefile b/Makefile index cf1f2e6..b6c4f91 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,8 @@ REPO := $(shell basename $(shell git remote get-url origin) .git) all: test test: .terraform - AWS_DEFAULT_REGION=us-east-2 terraform validate + terraform init -backend=false + terraform validate terraform fmt -check ! egrep "TF-UPGRADE-TODO|cites-illinois|as-aws-modules" *.tf README.md # Do NOT put terraform-aws in the title @@ -23,11 +24,13 @@ test: .terraform # DO put a badge in top-level README.md grep -q "\[\!\[Terraform actions status\]([^)]*$(REPO)/workflows/terraform/badge.svg)\]([^)]*$(REPO)/actions)" README.md # Do NOT use ?ref= in source lines in a README.md! - ! grep 'source\s*=.*?ref=' README.md + ! grep 'source\s*=.*?ref=' *.tf README.md # Do NOT start a source line with git:: ! grep 'source\s*=\s*"git::' *.tf README.md # Do NOT use .git in a source line ! grep 'source\s*=.*\.git.*"' *.tf README.md + @echo "" + @echo "tests passed" # Launches the Makefile inside a container docker: