Skip to content

Commit 85813da

Browse files
committed
update
1 parent 678856f commit 85813da

File tree

3 files changed

+43
-24
lines changed

3 files changed

+43
-24
lines changed

.github/workflows/terraform.yml

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'Terraform GitHub Actions'
22
on:
3-
- pull_request
3+
- push
44

55
jobs:
66
terraform:
@@ -11,37 +11,48 @@ jobs:
1111
- name: 'Checkout'
1212
uses: actions/checkout@master
1313

14-
- name: 'Terraform Format'
15-
uses: clouddrove/github-actions@v2.0
14+
- name: 'Terraform Format fmt'
15+
uses: hashicorp/terraform-github-actions@master
1616
with:
17-
actions_subcommand: 'fmt'
18-
19-
- name: 'Terraform Init'
20-
uses: clouddrove/github-actions@v2.0
21-
with:
22-
actions_subcommand: 'init'
23-
tf_actions_working_dir: ./_example
17+
tf_actions_version: 0.13.3
18+
tf_actions_subcommand: 'fmt'
19+
tf_actions_working_dir: "./_example"
20+
tf_actions_comment: true
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2423

2524
- name: Configure AWS Credentials
2625
uses: clouddrove/configure-aws-credentials@v1
2726
with:
28-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
29-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
27+
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
28+
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
3029
aws-region: us-east-2
3130

32-
- name: 'Terraform Plan'
33-
uses: clouddrove/github-actions@v2.0
31+
- name: Set up Go 1.13
32+
uses: actions/setup-go@v1
3433
with:
35-
actions_subcommand: 'plan'
36-
tf_actions_working_dir: ./_example
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
go-version: 1.13
35+
id: go
3936

40-
- name: 'Terratest'
41-
uses: clouddrove/github-actions@v2.0
37+
- name: Get dependencies
38+
run: |
39+
if [ -f Gopkg.toml ]; then
40+
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
41+
dep ensure
42+
else
43+
go get -v -t -d ./...
44+
fi
45+
- name: Test
46+
working-directory: ./_test
47+
run: go test
48+
49+
- name: 'Terraform Init'
50+
uses: hashicorp/terraform-github-actions@master
4251
with:
43-
actions_subcommand: 'terratest'
44-
tf_actions_working_dir: ./_test
52+
tf_actions_version: 0.13.3
53+
tf_actions_subcommand: 'init'
54+
tf_actions_working_dir: "./_example"
55+
tf_actions_comment: true
4556
env:
4657
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4758

@@ -53,5 +64,5 @@ jobs:
5364
author_name: 'Clouddrove'
5465
env:
5566
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
56-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
67+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
5768
if: always()

_example/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ provider "aws" {
33
}
44

55
module "vpc" {
6-
source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=tags/0.12.5"
6+
source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=tags/0.13.0"
77

88
name = "vpc"
99
application = "clouddrove"

_test/go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/clouddrove/terraform-aws-security-group
2+
3+
go 1.13
4+
5+
require (
6+
github.com/gruntwork-io/terratest v0.30.6
7+
github.com/stretchr/testify v1.6.1
8+
)

0 commit comments

Comments
 (0)