-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (83 loc) · 2.3 KB
/
test.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: ZT Test
on:
pull_request:
types: [opened, synchronize]
merge_group:
types: [checks_requested]
push:
branches:
- master
schedule:
- cron: '0 14 * * 1-5' # UTC
workflow_dispatch:
jobs:
test:
strategy:
matrix:
goVersion: ["1.21"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: install go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: checkout
uses: actions/checkout@v4
- name: Setup Go Tools
run: make tools
- name: Download Go Dependencies
run: |
go mod tidy && go mod vendor
- name: Setup Go Tools
run: make tools
- name: Check Formatting
run: make fmtcheck
- name: Vet
run: go vet ./...
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Check Build
run: make build
- name: setup Terraform
uses: hashicorp/setup-terraform@v3
- name: write ZPA Terraform configuration
run: |
cat > main.tf <<EOF
terraform {
required_providers {
zpa = {
source = "zscaler/zpa"
version = ">= 3"
}
}
}
EOF
- name: terraform init
run: terraform init
- name: write ZIA Terraform configuration
run: |
cat > main.tf <<EOF
terraform {
required_providers {
zia = {
source = "zscaler/zia"
version = ">= 2"
}
}
}
EOF
- name: terraform init
run: terraform init
- name: Run go test
env:
ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
ZPA_CLIENT_SECRET: ${{ secrets.ZPA_CLIENT_SECRET }}
ZPA_CUSTOMER_ID: ${{ secrets.ZPA_CUSTOMER_ID }}
ZPA_CLOUD: ${{ secrets.ZPA_CLOUD }}
ZIA_USERNAME: ${{ secrets.ZIA_USERNAME }}
ZIA_PASSWORD: ${{ secrets.ZIA_PASSWORD }}
ZIA_API_KEY: ${{ secrets.ZIA_API_KEY }}
ZIA_CLOUD: ${{ secrets.ZIA_CLOUD }}
ZSCALER_TERRAFORM_INSTALL_PATH: ${{ github.workspace }}
run: |