-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (85 loc) · 2.37 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
name: Terraform Provider Tests
on:
pull_request:
paths:
- '.github/workflows/test.yml'
- '**.go'
- 'go.mod'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: go build -o dist/terraform-provider-zoom .
- run: go fmt ./...
- name: Check no diff
run: |
git add .
git diff --cached --exit-code
unit:
name: Unit Tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version-file: 'go.mod'
cache: true
- run: go test -race -v -shffle on -cover ./...
acceptance:
name: Acceptance Tests (Terraform ${{ matrix.terraform-version }})
runs-on: ubuntu-latest
needs:
- build
strategy:
fail-fast: false
matrix:
terraform-version:
- '1.5.*'
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version-file: 'go.mod'
cache: true
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3
with:
terraform_version: ${{ matrix.terraform-version }}
terraform_wrapper: false
- run: go test -race -v -shuffle on -cover ./...
env:
TF_ACC: '1'
summary:
name: Summary
runs-on: ubuntu-latest
needs:
- build
- unit
- acceptance
timeout-minutes: 5
if: ${{ always() }}
steps:
- name: Success
run: |-
for status in ${{ join(needs.*.result, ' ') }}
do
if [ "$status" != "success" ] && [ "$status" != "skipped" ]
then
echo "Some checks failed"
exit 1
fi
done