-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (51 loc) · 1.53 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
name: terratest
permissions:
contents: write
pull-requests: write
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
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 }}
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 (latest)
uses: actions/setup-go@v4
with:
go-version: '>=1.17.0'
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 test_and_cover
- name: Release
uses: cycjimmy/semantic-release-action@v4
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]