forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.52 KB
/
unit-test-tgc.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
name: unit-test-tgc
permissions: read-all
on:
workflow_call:
jobs:
compile-and-unit-tests:
runs-on: ubuntu-22.04
steps:
- name: Download built artifacts
uses: actions/download-artifact@v2
with:
name: artifact-terraform-google-conversion
path: artifacts-tgc
- name: Download built artifacts
uses: actions/download-artifact@v2
with:
name: artifact-terraform-provider-google-beta
path: artifacts-tpgb
- name: Unzip the artifacts and delete the zip
run: |
unzip artifacts-tgc/output.zip -d ./tgc
unzip artifacts-tpgb/output.zip -d ./tpgb
rm artifacts-tgc/output.zip
rm artifacts-tpgb/output.zip
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '^1.20'
- name: Cache Go modules and build cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-test-terraform-google-conversion-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-test-terraform-google-conversion-${{ hashFiles('**/go.sum') }}
${{ runner.os }}-test-terraform-google-conversion-
- name: Build Terraform Google Conversion
run: |
cd tgc
go mod edit -replace=github.com/hashicorp/terraform-provider-google-beta=../tpgb
go mod tidy
make build
- name: Run Unit Tests
run: |
cd tgc
make test