9
9
- " other/clang-format-configuration/testdata/**"
10
10
- " other/clang-format-configuration/.clang-format"
11
11
- " .npmrc"
12
+ - " go.mod"
13
+ - " go.sum"
12
14
- " package.json"
13
15
- " package-lock.json"
14
16
- " Taskfile.ya?ml"
19
21
- " other/clang-format-configuration/testdata/**"
20
22
- " other/clang-format-configuration/.clang-format"
21
23
- " .npmrc"
24
+ - " go.mod"
25
+ - " go.sum"
22
26
- " package.json"
23
27
- " package-lock.json"
24
28
- " Taskfile.ya?ml"
@@ -43,22 +47,22 @@ jobs:
43
47
- name : Checkout repository
44
48
uses : actions/checkout@v5
45
49
50
+ - name : Install Go
51
+ uses : actions/setup-go@v5
52
+ with :
53
+ go-version-file : go.mod
54
+
46
55
- name : Setup Node.js
47
56
uses : actions/setup-node@v4
48
57
with :
49
58
node-version-file : package.json
50
59
51
- - name : Install Task
52
- uses : arduino/setup-task@v2
53
- with :
54
- repo-token : ${{ secrets.GITHUB_TOKEN }}
55
- version : 3.x
56
-
57
60
- name : Validate ClangFormat configuration files
58
61
run : |
59
- task \
60
- --silent \
61
- clang-format:validate
62
+ go tool \
63
+ github.com/go-task/task/v3/cmd/task \
64
+ --silent \
65
+ clang-format:validate
62
66
63
67
check-config :
64
68
runs-on : ubuntu-latest
@@ -68,17 +72,19 @@ jobs:
68
72
- name : Checkout repository
69
73
uses : actions/checkout@v5
70
74
71
- - name : Install Task
72
- uses : arduino /setup-task@v2
75
+ - name : Install Go
76
+ uses : actions /setup-go@v5
73
77
with :
74
- repo-token : ${{ secrets.GITHUB_TOKEN }}
75
- version : 3.x
78
+ go-version-file : go.mod
76
79
77
80
- name : Set environment variables
78
81
run : |
79
82
# See: https://docs.github.com/actions/reference/workflows-and-actions/workflow-commands#setting-an-environment-variable
80
83
if [[ "${{ github.event.inputs.clang-format-version }}" == "" ]]; then
81
- echo "CLANG_FORMAT_VERSION=$(task clang-format:get-version)" >>"$GITHUB_ENV"
84
+ echo "CLANG_FORMAT_VERSION=$(
85
+ go tool \
86
+ github.com/go-task/task/v3/cmd/task clang-format:get-version
87
+ )" >>"$GITHUB_ENV"
82
88
else
83
89
echo "CLANG_FORMAT_VERSION=${{ github.event.inputs.clang-format-version }}" >>"$GITHUB_ENV"
84
90
fi
@@ -110,10 +116,11 @@ jobs:
110
116
- name : Check ClangFormat configuration file
111
117
id : check
112
118
run : |
113
- task \
114
- --silent \
115
- clang-format:check-config \
116
- CLANG_FORMAT_VERSION="${{ env.CLANG_FORMAT_VERSION }}"
119
+ go tool \
120
+ github.com/go-task/task/v3/cmd/task \
121
+ --silent \
122
+ clang-format:check-config \
123
+ CLANG_FORMAT_VERSION="${{ env.CLANG_FORMAT_VERSION }}"
117
124
118
125
- name : Save effective configuration file to a workflow artifact
119
126
if : >
@@ -133,17 +140,19 @@ jobs:
133
140
- name : Checkout repository
134
141
uses : actions/checkout@v5
135
142
136
- - name : Install Task
137
- uses : arduino /setup-task@v2
143
+ - name : Install Go
144
+ uses : actions /setup-go@v5
138
145
with :
139
- repo-token : ${{ secrets.GITHUB_TOKEN }}
140
- version : 3.x
146
+ go-version-file : go.mod
141
147
142
148
- name : Set environment variables
143
149
run : |
144
150
# See: https://docs.github.com/actions/reference/workflows-and-actions/workflow-commands#setting-an-environment-variable
145
151
if [[ "${{ github.event.inputs.clang-format-version }}" == "" ]]; then
146
- echo "CLANG_FORMAT_VERSION=$(task clang-format:get-version)" >>"$GITHUB_ENV"
152
+ echo "CLANG_FORMAT_VERSION=$(
153
+ go tool \
154
+ github.com/go-task/task/v3/cmd/task clang-format:get-version
155
+ )" >>"$GITHUB_ENV"
147
156
else
148
157
echo "CLANG_FORMAT_VERSION=${{ github.event.inputs.clang-format-version }}" >>"$GITHUB_ENV"
149
158
fi
@@ -175,10 +184,11 @@ jobs:
175
184
- name : Check ClangFormat output
176
185
id : check
177
186
run : |
178
- task \
179
- clang-format:check-output \
180
- CLANG_FORMAT_VERSION="${{ env.CLANG_FORMAT_VERSION }}" \
181
- WORKING_FOLDER="${{ env.WORKING_FOLDER }}"
187
+ go tool \
188
+ github.com/go-task/task/v3/cmd/task \
189
+ clang-format:check-output \
190
+ CLANG_FORMAT_VERSION="${{ env.CLANG_FORMAT_VERSION }}" \
191
+ WORKING_FOLDER="${{ env.WORKING_FOLDER }}"
182
192
183
193
- name : Save formatted test data to a workflow artifact
184
194
if : >
@@ -198,17 +208,17 @@ jobs:
198
208
- name : Checkout repository
199
209
uses : actions/checkout@v5
200
210
201
- - name : Install Task
202
- uses : arduino /setup-task@v2
211
+ - name : Install Go
212
+ uses : actions /setup-go@v5
203
213
with :
204
- repo-token : ${{ secrets.GITHUB_TOKEN }}
205
- version : 3.x
214
+ go-version-file : go.mod
206
215
207
216
- name : Check ClangFormat test data
208
217
run : |
209
- task \
210
- --silent \
211
- clang-format:check-testdata
218
+ go tool \
219
+ github.com/go-task/task/v3/cmd/task \
220
+ --silent \
221
+ clang-format:check-testdata
212
222
213
223
convert :
214
224
runs-on : ubuntu-latest
@@ -228,18 +238,18 @@ jobs:
228
238
with :
229
239
node-version-file : package.json
230
240
231
- - name : Install Task
232
- uses : arduino /setup-task@v2
241
+ - name : Install Go
242
+ uses : actions /setup-go@v5
233
243
with :
234
- repo-token : ${{ secrets.GITHUB_TOKEN }}
235
- version : 3.x
244
+ go-version-file : go.mod
236
245
237
246
- name : Convert the ClangFormat configuration
238
247
run : |
239
- task \
240
- --silent \
241
- clang-format:convert \
242
- OUTPUT_PATH="${{ env.CONVERSION_OUTPUT_PATH }}"
248
+ go tool \
249
+ github.com/go-task/task/v3/cmd/task \
250
+ --silent \
251
+ clang-format:convert \
252
+ OUTPUT_PATH="${{ env.CONVERSION_OUTPUT_PATH }}"
243
253
244
254
- name : Save conversion to a workflow artifact
245
255
uses : actions/upload-artifact@v4
0 commit comments