@@ -2,14 +2,15 @@ name: Go
22
33on :
44 push :
5- branches : [ master ]
5+ branches : [master]
66 pull_request :
7- branches : [ master ]
7+ branches : [master]
88
99permissions :
1010 contents : read
1111
1212jobs :
13+ # # TODO: conditional-changes checker is not working
1314 conditional-changes :
1415 runs-on : ubuntu-latest
1516 permissions :
2728
2829 check-modules :
2930 name : check-synced-go-modules
30- needs : conditional-changes
31+ # needs: conditional-changes
3132 # if: needs.conditional-changes.outputs.doc == 'false'
3233 runs-on : [ubuntu-latest]
3334 steps :
3940 uses : actions/setup-go@v6
4041 with :
4142 go-version-file : go.work
43+ cache : true
44+ cache-dependency-path : |
45+ **/go.sum
4246 id : go
4347 - name : sync go modules
4448 run : make workspace-sync
4751
4852 lint :
4953 name : Lint
50- needs : conditional-changes
54+ # needs: conditional-changes
5155 # if: needs.conditional-changes.outputs.doc == 'false'
5256 runs-on : [ubuntu-latest]
5357 steps :
@@ -59,15 +63,19 @@ jobs:
5963 uses : actions/setup-go@v6
6064 with :
6165 go-version-file : go.work
66+ cache : true
67+ cache-dependency-path : |
68+ **/go.sum
6269 id : go
6370 - name : Lint
6471 run : make lint
6572 - name : Verify boilerplate
6673 run : make check-license
6774
68- test-linux :
75+ # # Test all modules without plugins and released modules
76+ test-non-released-modules :
6977 name : Test Linux
70- needs : conditional-changes
78+ # needs: conditional-changes
7179 # if: needs.conditional-changes.outputs.doc == 'false'
7280 runs-on : [ubuntu-latest]
7381 steps :
@@ -77,54 +85,59 @@ jobs:
7785 uses : actions/setup-go@v6
7886 with :
7987 go-version-file : go.work
88+ cache : true
89+ cache-dependency-path : |
90+ **/go.sum
8091 id : go
81- - name : Test all modules
82- run : make test-unit-non-plugin
92+ - name : Test all modules without plugins and released modules
93+ run : make test-unit-non-plugin-and-non-released
8394 env :
8495 KUSTOMIZE_DOCKER_E2E : true
8596
86- test-macos :
87- name : Test MacOS
88- needs : conditional-changes
97+ test-modules :
98+ name : Test ${{ matrix.os }} - ${{ matrix.module }}
99+ # needs: conditional-changes
89100 # if: needs.conditional-changes.outputs.doc == 'false'
90- runs-on : [macos-latest]
101+ runs-on : ${{ matrix.os }}
102+ strategy :
103+ fail-fast : false
104+ matrix :
105+ os : [ubuntu-latest, macos-latest, windows-latest]
106+ module :
107+ - kyaml
108+ - cmd/config
109+ - api
110+ - kustomize
111+ include :
112+ - module : kyaml
113+ test-cmd : go test -race -v -cover ./...
114+ - module : cmd/config
115+ test-cmd : go test -v -cover ./...
116+ - module : api
117+ test-cmd : go test -v -cover ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.buildDate=2023-01-31T23:38:41Z -X sigs.k8s.io/kustomize/api/provenance.version=(test)"
118+ - module : kustomize
119+ test-cmd : go test -v -cover ./...
120+ - os : ubuntu-latest
121+ docker-e2e : true
122+ - os : macos-latest
123+ docker-e2e : false
124+ - os : windows-latest
125+ docker-e2e : false
126+ env :
127+ KUSTOMIZE_DOCKER_E2E : ${{ matrix.docker-e2e }}
91128 steps :
92129 - name : Check out code into the Go module directory
93130 uses : actions/checkout@v5
94131 - name : Set up Go 1.x
95132 uses : actions/setup-go@v6
96133 with :
97134 go-version-file : go.work
135+ cache : true
136+ cache-dependency-path : |
137+ **/go.sum
98138 id : go
99- - name : Test all modules
100- run : make test-unit-non-plugin
101- env :
102- KUSTOMIZE_DOCKER_E2E : false # docker not installed on mac
103-
104- test-windows :
105- name : Test Windows
106- needs : conditional-changes
107- # if: needs.conditional-changes.outputs.doc == 'false'
108- runs-on : [windows-latest]
109- steps :
110- - name : Check out code into the Go module directory
111- uses : actions/checkout@v5
112- - name : Set up Go 1.x
113- uses : actions/setup-go@v6
114- with :
115- go-version-file : go.work
116- id : go
117- - name : Test kyaml
118- run : go test -cover ./...
119- working-directory : ./kyaml
120- - name : Test cmd/config
121- run : go test -cover ./...
122- working-directory : ./cmd/config
123- env :
124- KUSTOMIZE_DOCKER_E2E : false # docker on windows not working well yet
125-
126- # TODO (#4001): replace specific modules above with this once Windows tests are passing.
127- # - name: Test all modules
128- # run: make test-unit-non-plugin
129- # env:
130- # KUSTOMIZE_DOCKER_E2E: false # docker on windows not working well yet
139+ - name : Test ${{ matrix.module }}
140+ run : ${{ matrix.test-cmd }}
141+ # TODO (#4001): replace specific modules above with this once Windows tests are passing.
142+ if : ${{ !(matrix.os == 'windows-latest' && (matrix.module == 'api' || matrix.module == 'kustomize')) }}
143+ working-directory : ./${{ matrix.module }}
0 commit comments