-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (56 loc) · 1.65 KB
/
terratest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: terratest
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'modules/**'
- 'examples/**'
- 'test/**'
push:
branches:
- main
env:
TERRATEST_GOOGLE_CREDENTIALS: ${{ secrets.TERRATEST_GOOGLE_CREDENTIALS }}
GOOGLE_PROJECT: ${{ secrets.TERRATEST_GOOGLE_PROJECT }}
GCP_SA_EMAIL: ${{ secrets.TERRATEST_GCP_SA_EMAIL }}
TF_VAR_google_project: ${{ secrets.TERRATEST_GOOGLE_PROJECT }}
TF_VAR_google_credentials: ${{ secrets.TERRATEST_GOOGLE_CREDENTIALS }}
TF_VAR_shared_vpc_host_google_credentials: ${{ secrets.TERRATEST_GOOGLE_CREDENTIALS }}
TF_VAR_google_region: ${{ secrets.TERRATEST_GOOGLE_REGION }}
jobs:
terratest:
name: terratest
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Go (1.17)
uses: actions/setup-go@v2
with:
go-version: 1.17
id: go
- name: Login to Google Cloud
uses: google-github-actions/auth@v0
with:
credentials_json: ${{ env.TERRATEST_GOOGLE_CREDENTIALS }}
- name: Set Google Cloud project
run: gcloud config set project $GOOGLE_PROJECT
- name: Run terratest
run: |
make tests
- name: Release
uses: cycjimmy/semantic-release-action@v3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
extra_plugins: |
@semantic-release/git@10.0.1
@semantic-release/exec@6.0.3
@semantic-release/changelog@6.0.1