Skip to content

Commit

Permalink
Merge pull request #9 from karol-bujacek/simplify-github-workflow
Browse files Browse the repository at this point in the history
Simplify GitHub workflow
  • Loading branch information
martinhaus authored Aug 3, 2020
2 parents eb6341a + 81955b0 commit c5e23d4
Showing 1 changed file with 5 additions and 75 deletions.
80 changes: 5 additions & 75 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit c5e23d4

Please sign in to comment.