Skip to content

Update Terraform aws to v5.53.0 #137

Update Terraform aws to v5.53.0

Update Terraform aws to v5.53.0 #137

Workflow file for this run

name: CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch: # enable manual execution
env:
COOKIECUTTER_PARAM_REPO_NAME: "infra"
COOKIECUTTER_PARAM_ENVIRONMENT: "prod"
TERRAFORM_DIR: "infra/terraform"
TERRAFORM_PROD_DIR: "infra/terraform/prod"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
cookiecutter:
name: Cookiecutter
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: ShellCheck scripts
uses: ludeeus/[email protected]
env:
SHELLCHECK_OPTS: --severity style --enable all --exclude SC2312 --shell bash
with:
check_together: yes
scandir: "scripts"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Cookiecutter
run: pip install cookiecutter==2.6.0
- name: Generate project
run: |
cookiecutter . --no-input --verbose \
repo_name="${COOKIECUTTER_PARAM_REPO_NAME}" \
environment="${COOKIECUTTER_PARAM_ENVIRONMENT}"
- name: ShellCheck generated scripts
uses: ludeeus/[email protected]
env:
SHELLCHECK_OPTS: --severity style --enable all --exclude SC2312 --shell bash
with:
check_together: yes
scandir: "infra/scripts"
- name: Setup act
uses: actionsflow/setup-act@v1
- name: Test generated GitHub workflow
run: |
cd "${COOKIECUTTER_PARAM_REPO_NAME}"
act --dryrun --platform "ubuntu-latest=catthehacker/ubuntu:act-latest"
- name: Get Terraform version
run: |
source scripts/get_terraform_versions_dockerized.sh
echo "TERRAFORM_VERSION=${TERRAFORM_VERSION}" >> "${GITHUB_ENV}"
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Format check generated Terraform
run: terraform fmt -check -recursive "${TERRAFORM_DIR}/"
- name: Init generated Terraform
run: terraform -chdir="${TERRAFORM_PROD_DIR}" init -backend=false
- name: Validate generated Terraform
run: terraform -chdir="${TERRAFORM_PROD_DIR}" validate
- name: Upload generated project
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: ${{ env.COOKIECUTTER_PARAM_REPO_NAME }}
path: |
${{ env.COOKIECUTTER_PARAM_REPO_NAME }}/
!${{ env.TERRAFORM_PROD_DIR }}/.terraform
if-no-files-found: error