-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from karol-bujacek/simplify-github-workflow
Simplify GitHub workflow
- Loading branch information
Showing
1 changed file
with
5 additions
and
75 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 |
---|---|---|
|
@@ -6,88 +6,18 @@ on: | |
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
TERRAFORM_DOCS_VERSION: "v0.9.1" | ||
TFLINT_VERSION: "v0.16.2" | ||
|
||
jobs: | ||
terraform-validation: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/setup-python@v1 | ||
name: "SETUP: Python" | ||
|
||
- uses: actions/setup-go@v2 | ||
name: "SETUP: Go" | ||
|
||
- uses: pat-s/[email protected] | ||
id: cache-terraform-docs | ||
name: "CACHE: terraform-docs Go module" | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/go/bin/terraform-docs | ||
key: ${{ runner.os }}-terraform_docs-${{ env.TERRAFORM_DOCS_VERSION }} | ||
restore-keys: | | ||
${{ runner.os}}-terraform_docs- | ||
- shell: bash | ||
name: "INSTALL: terraform-docs" | ||
if: steps.cache-terraform-docs.output.cache-hit != 'true' | ||
env: | ||
GO111MODULE: "on" | ||
run: | | ||
go get github.com/segmentio/terraform-docs@${{ env.TERRAFORM_DOCS_VERSION }} | ||
- shell: bash | ||
name: "SETUP: Go path" | ||
run: echo '::add-path::~/go/bin/' | ||
|
||
- uses: actions/checkout@v1 | ||
name: Checkout source code | ||
|
||
- uses: pat-s/[email protected] | ||
id: cache-pre-commit-dependencies | ||
name: "CACHE: pip and pre-commit dependencies" | ||
with: | ||
path: | | ||
~/.cache/pre-commit | ||
~/.cache/pip | ||
key: ${{ runner.os }}-pip-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-pre-commit- | ||
- uses: pat-s/[email protected] | ||
id: cache-tflint | ||
name: "CACHE: TFLint" | ||
- uses: actions/setup-python@v1 | ||
- uses: lablabs/setup-terraform-docs@v1 | ||
- uses: lablabs/setup-tflint@v1 | ||
- uses: BSFishy/pip-action@v1 | ||
with: | ||
path: | | ||
~/tflint/bin/ | ||
key: ${{ runner.os }}-tflint-${{ env.TFLINT_VERSION }} | ||
restore-keys: | | ||
${{ runner.os }}-tflint- | ||
- shell: bash | ||
name: "INSTALL: detect-secrets" | ||
run: | | ||
pip install detect-secrets | ||
- shell: bash | ||
name: "INSTALL: TFLint" | ||
if: steps.cache-tflint.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://github.com/terraform-linters/tflint/releases/download/${{ env.TFLINT_VERSION }}/tflint_linux_amd64.zip | ||
unzip tflint_linux_amd64.zip | ||
mkdir -p ~/tflint/bin/ | ||
install tflint ~/tflint/bin/ | ||
- shell: bash | ||
name: "SETUP: TFLint path" | ||
run: | | ||
echo '::add-path::~/tflint/bin/' | ||
packages: detect-secrets | ||
- uses: pre-commit/[email protected] | ||
name: "RUN: pre-commit" | ||
env: | ||
AWS_DEFAULT_REGION: "eu-central-1" |