feat: Updated new feature and workflows #6
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: static-checks | |
on: | |
pull_request: | |
jobs: | |
versionExtract: | |
name: Get min/max versions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Terraform min/max versions | |
id: minMax | |
uses: clowdhaus/terraform-min-max@main | |
outputs: | |
minVersion: ${{ steps.minMax.outputs.minVersion }} | |
maxVersion: ${{ steps.minMax.outputs.maxVersion }} | |
versionEvaluate: | |
name: Evaluate Terraform versions | |
runs-on: ubuntu-latest | |
needs: versionExtract | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- ${{ needs.versionExtract.outputs.minVersion }} | |
- ${{ needs.versionExtract.outputs.maxVersion }} | |
directory: | |
- _example/ | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@master | |
- name: Auth Gcp | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GKE_KEY }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Init & validate v${{ matrix.version }} | |
run: | | |
cd ${{ matrix.directory }} | |
terraform init | |
terraform validate | |
- name: tflint | |
uses: reviewdog/action-tflint@master | |
with: | |
tflint_version: v0.29.0 | |
github_token: ${{ secrets.GITHUB }} | |
working_directory: ${{ matrix.directory }} | |
fail_on_error: 'true' | |
filter_mode: 'nofilter' | |
flags: '--module' | |
format: | |
name: Check code format | |
runs-on: ubuntu-latest | |
needs: versionExtract | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Terraform v${{ needs.versionExtract.outputs.maxVersion }} | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: ${{ needs.versionExtract.outputs.maxVersion }} | |
- name: Check Terraform format changes | |
run: terraform fmt --recursive |