-
Notifications
You must be signed in to change notification settings - Fork 2.4k
158 lines (150 loc) · 4.92 KB
/
Copy pathgo.yml
File metadata and controls
158 lines (150 loc) · 4.92 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Go
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
## TODO: conditional-changes checker is not working
conditional-changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
doc: ${{ steps.filter.outputs.doc }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706
id: filter
with:
filters: |
doc:
- 'site/**'
check-modules:
name: check-synced-go-modules
# needs: conditional-changes
# if: needs.conditional-changes.outputs.doc == 'false'
runs-on: [ubuntu-latest]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 0
- name: Set up Go 1.x
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16
with:
go-version-file: go.work
cache: true
cache-dependency-path: |
**/go.sum
id: go
- name: sync go modules
run: make workspace-sync
- name: check for changes with 'make workspace-sync'
run: git diff --exit-code
lint:
name: Lint
# needs: conditional-changes
# if: needs.conditional-changes.outputs.doc == 'false'
runs-on: [ubuntu-latest]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 0
- name: Set up Go 1.x
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16
with:
go-version-file: go.work
cache: true
cache-dependency-path: |
**/go.sum
id: go
- name: Lint
run: make lint
- name: Verify boilerplate
run: make check-license
## Test all modules without plugins and released modules
test-non-released-modules:
name: Test Linux
# needs: conditional-changes
# if: needs.conditional-changes.outputs.doc == 'false'
runs-on: [ubuntu-latest]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Set up Go 1.x
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16
with:
go-version-file: go.work
cache: true
cache-dependency-path: |
**/go.sum
id: go
- name: Test all modules without plugins and released modules
run: make test-unit-non-plugin-and-non-released
env:
KUSTOMIZE_DOCKER_E2E: true
test-modules:
name: Test ${{ matrix.os }} - ${{ matrix.module }}
# needs: conditional-changes
# if: needs.conditional-changes.outputs.doc == 'false'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
module:
- kyaml
- cmd/config
- api
- kustomize
include:
- module: kyaml
test-cmd: go test -race -v -cover ./...
- module: cmd/config
test-cmd: go test -v -cover ./...
- module: api
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)"
- module: kustomize
test-cmd: go test -v -cover ./...
- os: ubuntu-latest
docker-e2e: true
- os: macos-latest
docker-e2e: false
- os: windows-latest
docker-e2e: false
env:
KUSTOMIZE_DOCKER_E2E: ${{ matrix.docker-e2e }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Set up Go 1.x
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16
with:
go-version-file: go.work
cache: true
cache-dependency-path: |
**/go.sum
id: go
- name: Test ${{ matrix.module }}
run: ${{ matrix.test-cmd }}
# TODO (#4001): replace specific modules above with this once Windows tests are passing.
if: ${{ !(matrix.os == 'windows-latest' && (matrix.module == 'api' || matrix.module == 'kustomize')) }}
working-directory: ./${{ matrix.module }}
# Aggregation matrix tests from test-modules for branch protection rules
test-modules-summary:
name: Test Summary
runs-on: ubuntu-latest
needs: test-modules
if: always()
steps:
- name: Check test results
run: |
if [[ "${{ needs.test-modules.result }}" != "success" ]]; then
echo "Some tests failed or were cancelled"
exit 1
fi
echo "All tests passed successfully"