@@ -4,51 +4,60 @@ name: Tests
4
4
on :
5
5
push :
6
6
branches : [main]
7
+ paths-ignore :
8
+ - ' README.md'
7
9
pull_request :
8
10
branches : [main]
11
+ paths-ignore :
12
+ - ' README.md'
9
13
10
14
jobs :
11
15
build :
12
16
name : Build
13
17
runs-on : ubuntu-latest
14
18
timeout-minutes : 10
15
-
16
19
steps :
17
-
18
20
- name : Check out code into the Go module directory
19
21
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20
-
21
22
- name : Set up Go
22
23
uses : actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
23
24
with :
24
25
go-version-file : ' go.mod'
25
- id : go
26
-
26
+ cache : true
27
+ - name : Build provider
28
+ run : make build
27
29
- name : Run linters
28
30
uses : golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
29
31
with :
30
32
version : v1.59.1
31
33
34
+ generate :
35
+ runs-on : ubuntu-latest
36
+ steps :
37
+ - name : Check out code into the Go module directory
38
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39
+ - name : Set up Go
40
+ uses : actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
41
+ with :
42
+ go-version-file : ' go.mod'
43
+ cache : true
32
44
# We need the latest version of Terraform for our documentation generation to use
33
45
- uses : hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
34
46
name : Setup Terraform
35
47
with :
36
48
terraform_wrapper : false
37
-
38
49
- name : Generate
39
50
run : make generate
40
-
41
51
- name : Confirm no diff
42
52
run : |
43
53
git diff --compact-summary --exit-code || \
44
- (echo "*** Unexpected differences after code generation. Run 'make generate' and commit."; exit 1)
54
+ (echo; echo " Unexpected difference in directories after code generation. Run 'make generate' command and commit."; exit 1)
45
55
46
- - name : Build
47
- run : make build
48
-
49
56
acceptance_tests :
50
57
name : Acceptance Tests
51
- needs : build
58
+ needs :
59
+ - build
60
+ - generate
52
61
runs-on : ubuntu-latest
53
62
timeout-minutes : 20
54
63
strategy :
@@ -58,23 +67,20 @@ jobs:
58
67
steps :
59
68
- name : Check out code
60
69
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
61
-
62
70
- name : Setup Go
63
71
uses : actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
64
72
with :
65
73
go-version-file : ' go.mod'
66
74
check-latest : true
67
-
75
+ cache : true
68
76
- name : Install Kustomize
69
77
run : |
70
78
curl -sL "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
71
79
chmod +x ./kustomize
72
-
73
80
- name : Install Kind 0.24.0
74
81
run : |
75
82
curl -sLo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-$(uname)-amd64
76
83
chmod +x ./kind
77
-
78
84
- name : Set up ArgoCD ${{ matrix.argocd_version }}
79
85
env :
80
86
ARGOCD_VERSION : ${{ matrix.argocd_version }}
83
89
sh scripts/testacc_prepare_env.sh
84
90
until $(nc -z 127.0.0.1 8080); do sleep 2;done
85
91
netstat -tulpn
86
-
87
92
- name : Run acceptance tests
88
93
env :
89
94
ARGOCD_VERSION : ${{ matrix.argocd_version }}
0 commit comments