@@ -18,6 +18,34 @@ tasks:
18
18
- task : config:check
19
19
- task : general:check-formatting
20
20
21
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml
22
+ ci:validate :
23
+ desc : Validate GitHub Actions workflows against their JSON schema
24
+ vars :
25
+ # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
26
+ WORKFLOW_SCHEMA_URL : https://json.schemastore.org/github-workflow
27
+ WORKFLOW_SCHEMA_PATH :
28
+ sh : task utility:mktemp-file TEMPLATE="workflow-schema-XXXXXXXXXX.json"
29
+ WORKFLOWS_DATA_PATH : " ./.github/workflows/*.{yml,yaml}"
30
+ deps :
31
+ - task : npm:install-deps
32
+ cmds :
33
+ - |
34
+ wget \
35
+ --quiet \
36
+ --output-document="{{.WORKFLOW_SCHEMA_PATH}}" \
37
+ {{.WORKFLOW_SCHEMA_URL}}
38
+ - |
39
+ npx \
40
+ --package=ajv-cli \
41
+ --package=ajv-formats \
42
+ ajv validate \
43
+ --all-errors \
44
+ --strict=false \
45
+ -c ajv-formats \
46
+ -s "{{.WORKFLOW_SCHEMA_PATH}}" \
47
+ -d "{{.WORKFLOWS_DATA_PATH}}"
48
+
21
49
docs:generate :
22
50
desc : Create all generated documentation content
23
51
# This is an "umbrella" task used to call any documentation generation processes the project has.
@@ -206,6 +234,41 @@ tasks:
206
234
- task : test-unit
207
235
- task : go:test-integration
208
236
237
+ # Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout
238
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
239
+ utility:mktemp-file :
240
+ vars :
241
+ RAW_PATH :
242
+ sh : mktemp --tmpdir "{{.TEMPLATE}}"
243
+ cmds :
244
+ - task : utility:normalize-path
245
+ vars :
246
+ RAW_PATH : " {{.RAW_PATH}}"
247
+
248
+ # Make a temporary folder named according to the passed TEMPLATE variable and print the path passed to stdout
249
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
250
+ utility:mktemp-folder :
251
+ vars :
252
+ RAW_PATH :
253
+ sh : mktemp --directory --tmpdir "{{.TEMPLATE}}"
254
+ cmds :
255
+ - task : utility:normalize-path
256
+ vars :
257
+ RAW_PATH : " {{.RAW_PATH}}"
258
+
259
+ # Print a normalized version of the path passed via the RAW_PATH variable to stdout
260
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
261
+ utility:normalize-path :
262
+ cmds :
263
+ - |
264
+ if [[ "{{.OS}}" == "Windows_NT" ]] && which cygpath &>/dev/null; then
265
+ # Even though the shell handles POSIX format absolute paths as expected, external applications do not.
266
+ # So paths passed to such applications must first be converted to Windows format.
267
+ cygpath -w "{{.RAW_PATH}}"
268
+ else
269
+ echo "{{.RAW_PATH}}"
270
+ fi
271
+
209
272
vars :
210
273
PROJECT_NAME : " uno-r4-wifi-fwuploader-plugin"
211
274
DIST_DIR : " dist"
0 commit comments