-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (54 loc) · 1.68 KB
/
terratest.yaml
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
name: terratest
permissions:
contents: write
pull-requests: write
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
COMPUTE_GOOGLE_CREDENTIALS: ${{ secrets.TERRATEST_GOOGLE_CREDENTIALS_COMPUTE }}
COMPUTE_GOOGLE_PROJECT: ${{ secrets.TERRATEST_GOOGLE_PROJECT_COMPUTE }}
TF_VAR_google_credentials: ${{ secrets.TERRATEST_GOOGLE_CREDENTIALS_COMPUTE }}
TF_VAR_shared_vpc_host_google_credentials: ${{ secrets.TERRATEST_GOOGLE_CREDENTIALS_NETWORK }}
jobs:
terratest:
name: terratest
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
submodules: true
- name: Set up Go (1.19)
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: gcloud-auth
uses: google-github-actions/auth@v0
with:
credentials_json: ${{ env.COMPUTE_GOOGLE_CREDENTIALS }}
- name: gcloud-setup
uses: google-github-actions/setup-gcloud@v0
with:
version: "latest" # This is the default value, just being explicit
project_id: ${{ env.COMPUTE_GOOGLE_PROJECT }}
install_components: 'gke-gcloud-auth-plugin'
export_default_credentials: false
- name: Run terratest
run: |
cd test
go test -v -timeout 120m
- name: Release
if: github.event_name == 'push'
uses: cycjimmy/semantic-release-action@v3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]