ZT Test #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |