-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ENG-872): re-writing docs slightly to make more focused to Terr…
…aform
- Loading branch information
Tristan Watson
committed
Aug 8, 2024
1 parent
ce7a72e
commit cd0010b
Showing
7 changed files
with
97 additions
and
59 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: YAML Syntax Check | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint-yaml: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install yamllint | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install yamllint | ||
|
||
- name: Run yamllint | ||
run: yamllint . |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,40 @@ | ||
name: Common Terraform Checks | ||
run-name: 🔍 Terraform Checks - triggered by @${{ github.actor }} | ||
on: [push] | ||
jobs: | ||
terraform-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.5.7 # See upgrading docs regarding tfenv: https://www.notion.so/oaknationalacademy/Terraform-The-Oak-Guide-to-b3930c13433f48fa890968636f495098?pvs=4#4dee54a2e4714f55957b047c1d94c62a | ||
- name: "INFO: Acertain Terraform Version" | ||
shell: bash | ||
run: terraform --version | ||
- name: "INFO: Linting Terraform Files" | ||
shell: bash | ||
run: | | ||
cd infrastructure | ||
terraform fmt -check $(find . -name '*tf') | ||
- name: "INFO: Validate terraform configs" | ||
shell: bash | ||
run: | | ||
cd infrastructure | ||
for d in $(find . -type d -mindepth 1 -maxdepth 1) | ||
do | ||
echo "Validating the $d config" | ||
cd $d | ||
terraform init -backend=false | ||
terraform validate | ||
cd .. | ||
done | ||
name: "Terraform Checks" | ||
description: "Perform common Terraform checks" | ||
inputs: | ||
terraform_version: | ||
description: "Terraform version to use" | ||
required: false | ||
default: "1.5.7" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: ${{ inputs.terraform_version }} | ||
|
||
- name: "INFO: Ascertain Terraform Version" | ||
shell: bash | ||
run: terraform --version | ||
|
||
- name: "INFO: Linting Terraform Files" | ||
shell: bash | ||
run: | | ||
cd infrastructure | ||
terraform fmt -check $(find . -name '*tf') | ||
- name: "INFO: Validate Terraform Configs" | ||
shell: bash | ||
run: | | ||
cd infrastructure | ||
for d in $(find . -type d -mindepth 1 -maxdepth 1) | ||
do | ||
echo "Validating the $d config" | ||
cd $d | ||
terraform init -backend=false | ||
terraform validate | ||
cd .. | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Terraform Check - With Defined Version | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
terraform-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run Terraform Checks Action from oak-terraform-actions | ||
uses: oaknational/oak-actions/actions/terraform-checks@main | ||
with: | ||
terraform_version: 1.5.7 # or any other version as needed |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Terraform Check | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
example-job: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Run Terraform Action from oak-terraform-actions | ||
uses: oaknational/oak-actions/actions/terraform@main | ||
with: | ||
example_input: "value" |
This file was deleted.
Oops, something went wrong.