@@ -26,13 +26,13 @@ jobs:
26
26
- name : Check out code
27
27
uses : actions/checkout@v3
28
28
29
- - name : Install asdf
30
- uses : asdf-vm/actions/setup@v2
29
+ - name : Install devbox
30
+ uses :
jetpack-io/[email protected]
31
31
with :
32
- asdf_branch : v0.11.3
32
+ enable-cache : true
33
33
34
34
- name : Run unit tests
35
- run : make test
35
+ run : devbox run -- make test
36
36
37
37
- name : Annotate tests
38
38
if : always()
@@ -48,76 +48,97 @@ jobs:
48
48
with :
49
49
fetch-depth : 0
50
50
51
- - name : Install asdf
52
- uses : asdf-vm/actions/setup@v2
51
+ - name : Install devbox
52
+ uses :
jetpack-io/[email protected]
53
53
with :
54
- asdf_branch : v0.11.3
54
+ enable-cache : true
55
55
56
56
- name : Build and install on KinD
57
- run : make dev.run-on-kind
57
+ run : devbox run -- make dev.run-on-kind
58
58
env :
59
59
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60
60
61
61
- name : Run e2e tests
62
- run : make e2e-test
62
+ run : devbox run -- make e2e-test
63
63
env :
64
64
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
65
65
66
66
- name : Cleanup KinD cluster
67
67
if : always()
68
- run : make kind.delete
68
+ run : devbox run -- make kind.delete
69
69
70
- lint :
70
+ lint-go :
71
71
runs-on : ubuntu-22.04
72
72
steps :
73
73
- name : Check out code
74
74
uses : actions/checkout@v3
75
75
76
- - name : Gather tool versions
77
- uses : endorama/asdf-parse-tool-versions@v1
76
+ - name : Install devbox
77
+ uses :
jetpack-io/[email protected]
78
+ with :
79
+ enable-cache : true
80
+
81
+ - name : Export golang and golangci-lint versions
78
82
id : versions
83
+ run : |
84
+ echo "golangci-lint=$(devbox run -- golangci-lint version --format short)" >>"${GITHUB_OUTPUT}"
85
+ echo "golang=$(devbox run -- go version | grep -o "[[:digit:]]\+.[[:digit:]]\+\(.[[:digit:]]\+\)\?")" >>"${GITHUB_OUTPUT}"
79
86
80
87
- name : golangci-lint
81
88
uses : reviewdog/action-golangci-lint@v2
82
89
with :
83
90
fail_on_error : true
84
91
reporter : github-pr-review
85
- golangci_lint_version : v${{ fromJson( steps.versions.outputs.tools) .golangci-lint }}
86
- go_version : v${{ fromJson( steps.versions.outputs.tools) .golang }}
92
+ golangci_lint_version : v${{ steps.versions.outputs.golangci-lint }}
93
+ go_version : v${{ steps.versions.outputs.golang }}
87
94
88
- pre-commit :
95
+ lint-gha :
89
96
runs-on : ubuntu-22.04
90
97
steps :
91
98
- name : Check out code
92
99
uses : actions/checkout@v3
93
100
94
- - name : Gather tool versions
95
- uses : endorama/asdf-parse-tool-versions@v1
96
- id : versions
97
-
98
- - uses : actions/setup-go@v4
101
+ - name : actionlint
102
+ uses : reviewdog/action-actionlint@v1
99
103
with :
100
- go-version : ${{ fromJson(steps.versions.outputs.tools).golang }}
101
- check-latest : false
102
- cache : true
104
+ fail_on_error : true
105
+ reporter : github-pr-review
103
106
104
- - uses : mfinelli/setup-shfmt@v2
107
+ lint-dockerfile :
108
+ runs-on : ubuntu-22.04
109
+ steps :
110
+ - name : Check out code
111
+ uses : actions/checkout@v3
112
+
113
+ - name : actionlint
114
+ uses : reviewdog/action-hadolint@v1
105
115
with :
106
- shfmt-version : ${{ fromJson(steps.versions.outputs.tools).shfmt }}
116
+ fail_on_error : true
117
+ reporter : github-pr-review
107
118
108
- - name : Install asdf
109
- uses : asdf-vm/actions/setup@v2
119
+ pre-commit :
120
+ runs-on : ubuntu-22.04
121
+ steps :
122
+ - name : Check out code
123
+ uses : actions/checkout@v3
110
124
with :
111
- asdf_branch : v0.11.3
125
+ ref : ${{ github.event.pull_request.head.sha }}
112
126
113
- - name : Install helm-docs
114
- run : make install-tool.helm-docs
127
+ - name : Install devbox
128
+ uses :
jetpack-io/[email protected]
129
+ with :
130
+ enable-cache : true
115
131
116
- -
uses :
pre-commit/[email protected]
132
+ - name : Set up pre-commit cache
133
+ uses : actions/cache@v3
117
134
with :
118
- extra_args : --all-files --show-diff-on-failure
135
+ path : ~/.cache/pre-commit
136
+ key : pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
137
+
138
+ - name : Run pre-commit
139
+ run : devbox run -- make pre-commit
119
140
env :
120
- SKIP : no-commit-to-branch,golangci-lint
141
+ SKIP : no-commit-to-branch,golangci-lint,actionlint-system
121
142
122
143
lint-test-helm :
123
144
runs-on : ubuntu-22.04
@@ -127,70 +148,53 @@ jobs:
127
148
with :
128
149
fetch-depth : 0
129
150
130
- - name : Gather tool versions
131
- uses : endorama/asdf-parse-tool-versions@v1
132
- id : versions
133
-
134
- - name : Set up Helm
135
- uses : azure/setup-helm@v3
136
- with :
137
- version : v${{ fromJson(steps.versions.outputs.tools).helm }}
138
-
139
- - uses : actions/setup-python@v4
151
+ - name : Install devbox
152
+ uses :
jetpack-io/[email protected]
140
153
with :
141
- python-version : ' 3.10'
142
- check-latest : true
143
-
144
- - name : Set up chart-testing
145
- uses : helm/chart-testing-action@v2
146
- with :
147
- version : v${{ fromJson(steps.versions.outputs.tools).helm-ct }}
148
- yamllint_version : ${{ fromJson(steps.versions.outputs.tools).yamllint }}
154
+ enable-cache : true
149
155
150
156
- name : Run chart-testing (list-changed)
151
157
id : list-changed
152
158
run : |
153
- changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
159
+ git fetch origin main:main
160
+ changed=$(devbox run -- ct list-changed --target-branch ${{ github.event.repository.default_branch }})
154
161
if [[ -n "$changed" ]]; then
155
162
echo "changed=true" >> "$GITHUB_OUTPUT"
156
163
fi
157
164
158
165
- if : steps.list-changed.outputs.changed == 'true'
159
166
name : Run chart-testing (lint)
160
- run : ct lint --config charts/ct-config.yaml
167
+ run : devbox run -- ct lint --config charts/ct-config.yaml
161
168
162
169
- if : steps.list-changed.outputs.changed == 'true'
163
170
name : Create kind cluster
164
- uses : helm/kind-action@v1
165
- with :
166
- version : v${{ fromJson(steps.versions.outputs.tools).kind }}
167
- kubectl_version : v${{ fromJson(steps.versions.outputs.tools).kubectl }}
168
- node_image : ghcr.io/mesosphere/kind-node:v${{ fromJson(steps.versions.outputs.tools).kubectl }}
171
+ run : |
172
+ devbox run -- kind create cluster \
173
+ --image=ghcr.io/mesosphere/kind-node:"$(kubectl version --output=json --client | gojq --raw-output .clientVersion.gitVersion)" \
174
+ --name=chart-testing
169
175
env :
170
176
KUBECONFIG : ct-kind-kubeconfig
171
177
172
- - if : steps.list-changed.outputs.changed == 'true'
173
- name : Install asdf
174
- uses : asdf-vm/actions/setup@v2
175
- with :
176
- asdf_branch : v0.11.3
177
-
178
178
- if : steps.list-changed.outputs.changed == 'true'
179
179
name : Build Docker images
180
- run : make release-snapshot
180
+ run : devbox run -- make release-snapshot
181
181
182
182
- if : steps.list-changed.outputs.changed == 'true'
183
183
name : Sideload docker image
184
- run : kind load docker-image --name chart-testing "$(jq -r '.[] | select(.type == "Docker Image" and .goos == "linux" and .goarch == "amd64").name' dist/artifacts.json)"
184
+ run : devbox run -- kind load docker-image --name chart-testing "$(jq -r '.[] | select(.type == "Docker Image" and .goos == "linux" and .goarch == "amd64").name' dist/artifacts.json)"
185
185
186
186
- if : steps.list-changed.outputs.changed == 'true'
187
187
name : Setup Cluster API and cert-manager
188
- run : make clusterctl.init
188
+ run : devbox run -- make clusterctl.init
189
189
env :
190
190
KIND_KUBECONFIG : ct-kind-kubeconfig
191
191
192
192
- if : steps.list-changed.outputs.changed == 'true'
193
193
name : Run chart-testing (install)
194
- run : ct install --config charts/ct-config.yaml --helm-extra-set-args "--set=image.tag=$(jq -r .version dist/metadata.json)"
194
+ run : devbox run -- ct install --config charts/ct-config.yaml --helm-extra-set-args "--set=image.tag=$(jq -r .version dist/metadata.json)"
195
195
env :
196
196
KUBECONFIG : ct-kind-kubeconfig
197
+
198
+ - if : steps.list-changed.outputs.changed == 'true' && always()
199
+ name :
200
+ run : devbox run -- kind delete cluster --name chart-testing || true
0 commit comments