Skip to content

Commit

Permalink
Merge pull request #3 from kobrikx/master
Browse files Browse the repository at this point in the history
Add Terraform testing in Github Action
  • Loading branch information
AutomationD authored Jun 15, 2020
2 parents 6e03e19 + 7fe3719 commit 795d1e9
Showing 1 changed file with 61 additions and 10 deletions.
71 changes: 61 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,71 @@
name: "Terraform Module Update"
defaults:
run:
shell: bash

name: ReviewDog
on:
push:
branches:
- develop
- master
pull_request:


jobs:
module:
reviewdog-github-check:
if: github.event_name == 'push'
name: ReviewDog (github-check)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Terraform init
run: terraform init

- name: Setup ReviewDog
run: |
mkdir -p $HOME/bin && curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b $HOME/bin
echo ::add-path::$HOME/bin
- name: Run ReviewDog (github-check)
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker run --rm --name tflint -v $PWD:/data -t wata727/tflint --format=checkstyle | reviewdog -f=checkstyle -name="github-check" -reporter=github-check -level=warning -filter-mode=nofilter
reviewdog-pr:
if: github.event_name == 'pull_request'
name: ReviewDog on Pull Request
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2-beta
- name: Checkout
uses: actions/checkout@v2

- name: Create AWS Profile
run: make test
- name: Terraform init
run: terraform init

- name: Setup ReviewDog
run: |
mkdir -p $HOME/bin && curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b $HOME/bin
echo ::add-path::$HOME/bin
- name: Run ReviewDog (github-pr-check)
continue-on-error: true
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker run --rm --name tflint -v $PWD:/data -t wata727/tflint --format=checkstyle | reviewdog -f=checkstyle -reporter=github-pr-check -name=github-pr-check-info
- name: Run ReviewDog (github-pr-check with fail-on-error)
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker run --rm --name tflint -v $PWD:/data -t wata727/tflint --format=checkstyle | reviewdog -f=checkstyle -name=pr-check-fail-on-error -reporter=github-pr-check -fail-on-error -filter-mode=nofilter
checkov-check:
name: Checkov (github-check)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run Checkov CLI test
continue-on-error: true
run: docker run --rm --name checkov -v $PWD:/tf bridgecrew/checkov -d /tf -o cli

0 comments on commit 795d1e9

Please sign in to comment.