Skip to content

Commit 2d1e3e5

Browse files
committed
Manage versioning of Task tool dependency
The "Task" task runner tool is used to perform all common development and maintenance operations for the project. Previously, the version of Task was not well managed. The GitHub Actions workflows used the latest version of Task, only constrained by major version. This meant that the GitHub Actions workflows could break at any time through a new release of Task that contained regressions or breaking changes. The contributors used whichever version of Task happened to be installed on their machine. This meant that they might get different results from that produced by the environment of the GitHub Actions workflows. The better solution is to take the same approach for managing the Task dependency as is done for the project's other dependencies: * Install a specific version of Task according to a single source of versioning data. * Use the Dependabot service to get automated update pull requests. Since Task is a Go module-based project, this can be accomplished by using the Go modules system, which has explicit support for tool dependencies as of the Go 1.24 release.
1 parent 330fe2d commit 2d1e3e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+545
-389
lines changed

.github/workflows/check-code-generation-task.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,10 @@ jobs:
5959
with:
6060
go-version-file: go.mod
6161

62-
- name: Install Task
63-
uses: arduino/setup-task@v2
64-
with:
65-
repo-token: ${{ secrets.GITHUB_TOKEN }}
66-
version: 3.x
67-
6862
- name: Generate code
69-
run: task go:generate
63+
run: |
64+
go tool \
65+
github.com/go-task/task/v3/cmd/task go:generate
7066
7167
- name: Check for forgotten code generation
7268
run: git diff --color --exit-code

.github/workflows/check-general-formatting-task.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ jobs:
5353
- name: Checkout repository
5454
uses: actions/checkout@v5
5555

56-
- name: Install Task
57-
uses: arduino/setup-task@v2
56+
- name: Install Go
57+
uses: actions/setup-go@v6
5858
with:
59-
repo-token: ${{ secrets.GITHUB_TOKEN }}
60-
version: 3.x
59+
go-version-file: go.mod
6160

6261
- name: Download latest editorconfig-checker release binary package
6362
id: download
@@ -87,6 +86,7 @@ jobs:
8786
8887
- name: Check formatting
8988
run: |
90-
task \
91-
--silent \
92-
general:check-formatting
89+
go tool \
90+
github.com/go-task/task/v3/cmd/task \
91+
--silent \
92+
general:check-formatting

.github/workflows/check-go-dependencies-task.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,12 @@ jobs:
8585
with:
8686
go-version-file: go.mod
8787

88-
- name: Install Task
89-
uses: arduino/setup-task@v2
90-
with:
91-
repo-token: ${{ secrets.GITHUB_TOKEN }}
92-
version: 3.x
93-
9488
- name: Update dependencies license metadata cache
9589
run: |
96-
task \
97-
--silent \
98-
general:cache-dep-licenses
90+
go tool \
91+
github.com/go-task/task/v3/cmd/task \
92+
--silent \
93+
general:cache-dep-licenses
9994
10095
- name: Check for outdated cache
10196
id: diff
@@ -152,14 +147,9 @@ jobs:
152147
with:
153148
go-version-file: go.mod
154149

155-
- name: Install Task
156-
uses: arduino/setup-task@v2
157-
with:
158-
repo-token: ${{ secrets.GITHUB_TOKEN }}
159-
version: 3.x
160-
161150
- name: Check for dependencies with unapproved licenses
162151
run: |
163-
task \
164-
--silent \
165-
general:check-dep-licenses
152+
go tool \
153+
github.com/go-task/task/v3/cmd/task \
154+
--silent \
155+
general:check-dep-licenses

.github/workflows/check-go-task.yml

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,12 @@ jobs:
7575
with:
7676
go-version-file: go.mod
7777

78-
- name: Install Task
79-
uses: arduino/setup-task@v2
80-
with:
81-
repo-token: ${{ secrets.GITHUB_TOKEN }}
82-
version: 3.x
83-
8478
- name: Check for errors
8579
env:
8680
GO_MODULE_PATH: ${{ matrix.module.path }}
87-
run: task go:vet
81+
run: |
82+
go tool \
83+
github.com/go-task/task/v3/cmd/task go:vet
8884
8985
check-outdated:
9086
name: check-outdated (${{ matrix.module.path }})
@@ -112,16 +108,12 @@ jobs:
112108
with:
113109
go-version-file: ${{ matrix.module.path }}/go.mod
114110

115-
- name: Install Task
116-
uses: arduino/setup-task@v2
117-
with:
118-
repo-token: ${{ secrets.GITHUB_TOKEN }}
119-
version: 3.x
120-
121111
- name: Modernize usages of outdated APIs
122112
env:
123113
GO_MODULE_PATH: ${{ matrix.module.path }}
124-
run: task go:fix
114+
run: |
115+
go tool \
116+
github.com/go-task/task/v3/cmd/task go:fix
125117
126118
- name: Check if any fixes were needed
127119
run: |
@@ -155,22 +147,17 @@ jobs:
155147
with:
156148
go-version-file: ${{ matrix.module.path }}/go.mod
157149

158-
- name: Install Task
159-
uses: arduino/setup-task@v2
160-
with:
161-
repo-token: ${{ secrets.GITHUB_TOKEN }}
162-
version: 3.x
163-
164150
- name: Install golint
165151
run: go install golang.org/x/lint/golint@latest
166152

167153
- name: Check style
168154
env:
169155
GO_MODULE_PATH: ${{ matrix.module.path }}
170156
run: |
171-
task \
172-
--silent \
173-
go:lint
157+
go tool \
158+
github.com/go-task/task/v3/cmd/task \
159+
--silent \
160+
go:lint
174161
175162
check-formatting:
176163
name: check-formatting (${{ matrix.module.path }})
@@ -198,16 +185,12 @@ jobs:
198185
with:
199186
go-version-file: ${{ matrix.module.path }}/go.mod
200187

201-
- name: Install Task
202-
uses: arduino/setup-task@v2
203-
with:
204-
repo-token: ${{ secrets.GITHUB_TOKEN }}
205-
version: 3.x
206-
207188
- name: Format code
208189
env:
209190
GO_MODULE_PATH: ${{ matrix.module.path }}
210-
run: task go:format
191+
run: |
192+
go tool \
193+
github.com/go-task/task/v3/cmd/task go:format
211194
212195
- name: Check formatting
213196
run: |
@@ -241,16 +224,12 @@ jobs:
241224
with:
242225
go-version-file: ${{ matrix.module.path }}/go.mod
243226

244-
- name: Install Task
245-
uses: arduino/setup-task@v2
246-
with:
247-
repo-token: ${{ secrets.GITHUB_TOKEN }}
248-
version: 3.x
249-
250227
- name: Run go mod tidy
251228
env:
252229
GO_MODULE_PATH: ${{ matrix.module.path }}
253-
run: task go:tidy
230+
run: |
231+
go tool \
232+
github.com/go-task/task/v3/cmd/task go:tidy
254233
255234
- name: Check whether any tidying was needed
256235
run: |

.github/workflows/check-markdown-task.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ jobs:
7676
- name: Checkout repository
7777
uses: actions/checkout@v5
7878

79+
- name: Install Go
80+
uses: actions/setup-go@v6
81+
with:
82+
go-version-file: go.mod
83+
7984
- name: Setup Node.js
8085
uses: actions/setup-node@v5
8186
with:
@@ -84,14 +89,10 @@ jobs:
8489
- name: Initialize markdownlint-cli problem matcher
8590
uses: xt0rted/markdownlint-problem-matcher@v3
8691

87-
- name: Install Task
88-
uses: arduino/setup-task@v2
89-
with:
90-
repo-token: ${{ secrets.GITHUB_TOKEN }}
91-
version: 3.x
92-
9392
- name: Lint
94-
run: task markdown:lint
93+
run: |
94+
go tool \
95+
github.com/go-task/task/v3/cmd/task markdown:lint
9596
9697
links:
9798
needs: run-determination
@@ -114,14 +115,9 @@ jobs:
114115
with:
115116
node-version-file: package.json
116117

117-
- name: Install Task
118-
uses: arduino/setup-task@v2
119-
with:
120-
repo-token: ${{ secrets.GITHUB_TOKEN }}
121-
version: 3.x
122-
123118
- name: Check links
124119
run: |
125-
task \
126-
--silent \
127-
markdown:check-links
120+
go tool \
121+
github.com/go-task/task/v3/cmd/task \
122+
--silent \
123+
markdown:check-links

.github/workflows/check-mkdocs-task.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ jobs:
9393
with:
9494
node-version-file: package.json
9595

96-
- name: Install Task
97-
uses: arduino/setup-task@v2
98-
with:
99-
repo-token: ${{ secrets.GITHUB_TOKEN }}
100-
version: 3.x
101-
10296
- name: Build website
103-
run: task website:check
97+
run: |
98+
go tool \
99+
github.com/go-task/task/v3/cmd/task website:check

.github/workflows/check-npm-task.yml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ on:
1010
- "**/.npmrc"
1111
- "**/package.json"
1212
- "**/package-lock.json"
13+
- "go.mod"
14+
- "go.sum"
1315
- "Taskfile.ya?ml"
1416
pull_request:
1517
paths:
1618
- ".github/workflows/check-npm-task.ya?ml"
1719
- "**/.npmrc"
1820
- "**/package.json"
1921
- "**/package-lock.json"
22+
- "go.mod"
23+
- "go.sum"
2024
- "Taskfile.ya?ml"
2125
schedule:
2226
# Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema.
@@ -67,23 +71,23 @@ jobs:
6771
- name: Checkout repository
6872
uses: actions/checkout@v5
6973

74+
- name: Install Go
75+
uses: actions/setup-go@v6
76+
with:
77+
go-version-file: go.mod
78+
7079
- name: Setup Node.js
7180
uses: actions/setup-node@v5
7281
with:
7382
node-version-file: package.json
7483

75-
- name: Install Task
76-
uses: arduino/setup-task@v2
77-
with:
78-
repo-token: ${{ secrets.GITHUB_TOKEN }}
79-
version: 3.x
80-
8184
- name: Validate package.json
8285
run: |
83-
task \
84-
--silent \
85-
npm:validate \
86-
PROJECT_PATH="${{ matrix.project.path }}"
86+
go tool \
87+
github.com/go-task/task/v3/cmd/task \
88+
--silent \
89+
npm:validate \
90+
PROJECT_PATH="${{ matrix.project.path }}"
8791
8892
check-sync:
8993
name: check-sync (${{ matrix.project.path }})
@@ -103,21 +107,21 @@ jobs:
103107
- name: Checkout repository
104108
uses: actions/checkout@v5
105109

110+
- name: Install Go
111+
uses: actions/setup-go@v6
112+
with:
113+
go-version-file: go.mod
114+
106115
- name: Setup Node.js
107116
uses: actions/setup-node@v5
108117
with:
109118
node-version-file: "${{ matrix.project.path }}/package.json"
110119

111-
- name: Install Task
112-
uses: arduino/setup-task@v2
113-
with:
114-
repo-token: ${{ secrets.GITHUB_TOKEN }}
115-
version: 3.x
116-
117120
- name: Install npm dependencies
118121
run: |
119-
task npm:install-deps \
120-
PROJECT_PATH="${{ matrix.project.path }}"
122+
go tool \
123+
github.com/go-task/task/v3/cmd/task npm:install-deps \
124+
PROJECT_PATH="${{ matrix.project.path }}"
121125
122126
- name: Check package-lock.json
123127
run: |
@@ -144,21 +148,21 @@ jobs:
144148
- name: Checkout repository
145149
uses: actions/checkout@v5
146150

151+
- name: Install Go
152+
uses: actions/setup-go@v6
153+
with:
154+
go-version-file: go.mod
155+
147156
- name: Setup Node.js
148157
uses: actions/setup-node@v5
149158
with:
150159
node-version-file: "${{ matrix.project.path }}/package.json"
151160

152-
- name: Install Task
153-
uses: arduino/setup-task@v2
154-
with:
155-
repo-token: ${{ secrets.GITHUB_TOKEN }}
156-
version: 3.x
157-
158161
- name: Fix problems in npm configuration file
159162
run: |
160-
task npm:fix-config \
161-
PROJECT_PATH="${{ matrix.project.path }}"
163+
go tool \
164+
github.com/go-task/task/v3/cmd/task npm:fix-config \
165+
PROJECT_PATH="${{ matrix.project.path }}"
162166
163167
- name: Check if fixes are needed in npm configuration file
164168
run: |

0 commit comments

Comments
 (0)