Migrate NAT instances to Amazon Linux 2 #208
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Continuous Integration" | |
on: | |
push: | |
branches: [master] | |
pull_request: {} | |
env: | |
AWS_REGION: eu-west-1 | |
jobs: | |
terraform-fmt: | |
name: Check formatting | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Terraform 1.x | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: 1.x | |
- name: terraform fmt | |
run: terraform fmt -recursive -check -diff | |
terraform-docs: | |
name: Check documentation | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup terraform-docs | |
env: | |
VERSION: "0.14.1" | |
run: | | |
set -e | |
mkdir -p /tmp/terraform-docs/bin | |
cd /tmp/terraform-docs/bin | |
curl -sSLo terraform-docs.tar.gz https://terraform-docs.io/dl/v$VERSION/terraform-docs-v$VERSION-$(uname)-amd64.tar.gz | |
tar -xzf terraform-docs.tar.gz | |
chmod +x terraform-docs | |
rm terraform-docs.tar.gz | |
echo /tmp/terraform-docs/bin >>$GITHUB_PATH | |
- name: terraform docs | |
run: tools/bin/check-all-docs | |
download_providers: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
tf_version: | |
- "0.12.x" | |
- "0.13.x" | |
- "0.14.x" | |
- "1.x" | |
name: "[terraform ${{ matrix.tf_version }}] Download providers" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: ${{ matrix.tf_version }} | |
- name: Setup providers cache | |
id: cache_providers | |
uses: actions/cache@v2 | |
with: | |
path: | | |
./.terraform/plugins | |
./.terraform/providers | |
key: ${{ runner.os }}-terraform-${{ matrix.tf_version }}-providers-${{ hashFiles('./versions.tf') }} | |
- name: Download providers | |
id: download_providers | |
if: steps.cache_providers.outputs.cache-hit != 'true' | |
run: terraform init -backend=false | |
terraform-validate-modules: | |
needs: [download_providers] | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
tf_version: | |
- "0.12.x" | |
- "0.13.x" | |
- "0.14.x" | |
- "1.x" | |
name: "[terraform ${{ matrix.tf_version }}] Validate modules" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: ${{ matrix.tf_version }} | |
- name: Download cached providers | |
uses: codequest-eu/restore-cache-action@master | |
with: | |
path: | | |
./.terraform/plugins | |
./.terraform/providers | |
key: ${{ runner.os }}-terraform-${{ matrix.tf_version }}-providers-${{ hashFiles('./versions.tf') }} | |
- name: terraform validate | |
run: | | |
case '${{ matrix.tf_version }}' in | |
0.12.*) plugins="$PWD/.terraform/plugins/linux_amd64" ;; | |
0.13.*) plugins="$PWD/.terraform/plugins" ;; | |
*) plugins="$PWD/.terraform/providers" ;; | |
esac | |
export TF_CLI_ARGS_init="-plugin-dir='$plugins'" | |
tools/bin/validate-all-modules | |
terraform-validate-examples: | |
needs: [download_providers] | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
tf_version: | |
- "0.12.x" | |
- "0.13.x" | |
- "0.14.x" | |
- "1.x" | |
name: "[terraform ${{ matrix.tf_version }}] Validate examples" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: ${{ matrix.tf_version }} | |
- name: Download cached providers | |
uses: codequest-eu/restore-cache-action@master | |
with: | |
path: | | |
./.terraform/plugins | |
./.terraform/providers | |
key: ${{ runner.os }}-terraform-${{ matrix.tf_version }}-providers-${{ hashFiles('./versions.tf') }} | |
- name: terraform validate | |
run: | | |
case '${{ matrix.tf_version }}' in | |
0.12.*) plugins="$PWD/.terraform/plugins/linux_amd64" ;; | |
0.13.*) plugins="$PWD/.terraform/plugins" ;; | |
*) plugins="$PWD/.terraform/providers" ;; | |
esac | |
export TF_CLI_ARGS_init="-plugin-dir='$plugins'" | |
tools/bin/validate-all-examples |