Skip to content

Commit

Permalink
Merge pull request #1 from clouddrove/PR-1
Browse files Browse the repository at this point in the history
github action
  • Loading branch information
Sohan Yadav authored May 24, 2020
2 parents 88e4027 + 30f08a2 commit e10dce1
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
57 changes: 57 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Terraform GitHub Actions'
on:
- pull_request

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
steps:

- name: 'Checkout'
uses: actions/checkout@master

- name: 'Terraform Format'
uses: clouddrove/[email protected]
with:
actions_subcommand: 'fmt'

- name: 'Terraform Init'
uses: clouddrove/[email protected]
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example

- name: Configure AWS Credentials
uses: clouddrove/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: 'Terraform Plan'
uses: clouddrove/[email protected]
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Terratest'
uses: clouddrove/[email protected]
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: ./_test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'Clouddrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
if: always()
3 changes: 2 additions & 1 deletion _test/labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ func Test(t *testing.T) {
// Check that we get back the outputs that we expect
assert.Equal(t, "labels-clouddrove-test", Tags["Name"])
assert.Equal(t, "labels-clouddrove-test", Id)
}
}

0 comments on commit e10dce1

Please sign in to comment.