|
39 | 39 | )
|
40 | 40 |
|
41 | 41 | tasks:
|
| 42 | + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml |
| 43 | + ci:validate: |
| 44 | + desc: Validate GitHub Actions workflows against their JSON schema |
| 45 | + vars: |
| 46 | + # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json |
| 47 | + WORKFLOW_SCHEMA_URL: https://json.schemastore.org/github-workflow |
| 48 | + WORKFLOW_SCHEMA_PATH: |
| 49 | + sh: task utility:mktemp-file TEMPLATE="workflow-schema-XXXXXXXXXX.json" |
| 50 | + WORKFLOWS_DATA_PATH: "./.github/workflows/*.{yml,yaml}" |
| 51 | + deps: |
| 52 | + - task: npm:install-deps |
| 53 | + cmds: |
| 54 | + - | |
| 55 | + wget \ |
| 56 | + --quiet \ |
| 57 | + --output-document="{{.WORKFLOW_SCHEMA_PATH}}" \ |
| 58 | + {{.WORKFLOW_SCHEMA_URL}} |
| 59 | + - | |
| 60 | + npx \ |
| 61 | + --package=ajv-cli \ |
| 62 | + --package=ajv-formats \ |
| 63 | + ajv validate \ |
| 64 | + --all-errors \ |
| 65 | + --strict=false \ |
| 66 | + -c ajv-formats \ |
| 67 | + -s "{{.WORKFLOW_SCHEMA_PATH}}" \ |
| 68 | + -d "{{.WORKFLOWS_DATA_PATH}}" |
| 69 | +
|
| 70 | + docs:generate: |
| 71 | + desc: Create all generated documentation content |
| 72 | + # This is an "umbrella" task used to call any documentation generation processes the project has. |
| 73 | + # It can be left empty if there are none. |
| 74 | + |
42 | 75 | download-dfu-util:
|
43 | 76 | desc: download dfu-util and copy the files in the correct dir
|
44 | 77 | cmds:
|
@@ -138,80 +171,6 @@ tasks:
|
138 | 171 | cmds:
|
139 | 172 | - go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
|
140 | 173 |
|
141 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml |
142 |
| - ci:validate: |
143 |
| - desc: Validate GitHub Actions workflows against their JSON schema |
144 |
| - vars: |
145 |
| - # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json |
146 |
| - WORKFLOW_SCHEMA_URL: https://json.schemastore.org/github-workflow |
147 |
| - WORKFLOW_SCHEMA_PATH: |
148 |
| - sh: task utility:mktemp-file TEMPLATE="workflow-schema-XXXXXXXXXX.json" |
149 |
| - WORKFLOWS_DATA_PATH: "./.github/workflows/*.{yml,yaml}" |
150 |
| - deps: |
151 |
| - - task: npm:install-deps |
152 |
| - cmds: |
153 |
| - - | |
154 |
| - wget \ |
155 |
| - --quiet \ |
156 |
| - --output-document="{{.WORKFLOW_SCHEMA_PATH}}" \ |
157 |
| - {{.WORKFLOW_SCHEMA_URL}} |
158 |
| - - | |
159 |
| - npx \ |
160 |
| - --package=ajv-cli \ |
161 |
| - --package=ajv-formats \ |
162 |
| - ajv validate \ |
163 |
| - --all-errors \ |
164 |
| - --strict=false \ |
165 |
| - -c ajv-formats \ |
166 |
| - -s "{{.WORKFLOW_SCHEMA_PATH}}" \ |
167 |
| - -d "{{.WORKFLOWS_DATA_PATH}}" |
168 |
| -
|
169 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml |
170 |
| - npm:install-deps: |
171 |
| - desc: Install dependencies managed by npm |
172 |
| - cmds: |
173 |
| - - npm install |
174 |
| - |
175 |
| - # Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout |
176 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml |
177 |
| - utility:mktemp-file: |
178 |
| - vars: |
179 |
| - RAW_PATH: |
180 |
| - sh: mktemp --tmpdir "{{.TEMPLATE}}" |
181 |
| - cmds: |
182 |
| - - task: utility:normalize-path |
183 |
| - vars: |
184 |
| - RAW_PATH: "{{.RAW_PATH}}" |
185 |
| - |
186 |
| - # Make a temporary folder named according to the passed TEMPLATE variable and print the path passed to stdout |
187 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml |
188 |
| - utility:mktemp-folder: |
189 |
| - vars: |
190 |
| - RAW_PATH: |
191 |
| - sh: mktemp --directory --tmpdir "{{.TEMPLATE}}" |
192 |
| - cmds: |
193 |
| - - task: utility:normalize-path |
194 |
| - vars: |
195 |
| - RAW_PATH: "{{.RAW_PATH}}" |
196 |
| - |
197 |
| - # Print a normalized version of the path passed via the RAW_PATH variable to stdout |
198 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml |
199 |
| - utility:normalize-path: |
200 |
| - cmds: |
201 |
| - - | |
202 |
| - if [[ "{{.OS}}" == "Windows_NT" ]] && which cygpath &>/dev/null; then |
203 |
| - # Even though the shell handles POSIX format absolute paths as expected, external applications do not. |
204 |
| - # So paths passed to such applications must first be converted to Windows format. |
205 |
| - cygpath -w "{{.RAW_PATH}}" |
206 |
| - else |
207 |
| - echo "{{.RAW_PATH}}" |
208 |
| - fi |
209 |
| -
|
210 |
| - docs:generate: |
211 |
| - desc: Create all generated documentation content |
212 |
| - # This is an "umbrella" task used to call any documentation generation processes the project has. |
213 |
| - # It can be left empty if there are none. |
214 |
| - |
215 | 174 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
|
216 | 175 | markdown:check-links:
|
217 | 176 | desc: Check for broken links
|
@@ -286,3 +245,44 @@ tasks:
|
286 | 245 | - task: npm:install-deps
|
287 | 246 | cmds:
|
288 | 247 | - npx markdownlint-cli "**/*.md"
|
| 248 | + |
| 249 | + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml |
| 250 | + npm:install-deps: |
| 251 | + desc: Install dependencies managed by npm |
| 252 | + cmds: |
| 253 | + - npm install |
| 254 | + |
| 255 | + # Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout |
| 256 | + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml |
| 257 | + utility:mktemp-file: |
| 258 | + vars: |
| 259 | + RAW_PATH: |
| 260 | + sh: mktemp --tmpdir "{{.TEMPLATE}}" |
| 261 | + cmds: |
| 262 | + - task: utility:normalize-path |
| 263 | + vars: |
| 264 | + RAW_PATH: "{{.RAW_PATH}}" |
| 265 | + |
| 266 | + # Make a temporary folder named according to the passed TEMPLATE variable and print the path passed to stdout |
| 267 | + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml |
| 268 | + utility:mktemp-folder: |
| 269 | + vars: |
| 270 | + RAW_PATH: |
| 271 | + sh: mktemp --directory --tmpdir "{{.TEMPLATE}}" |
| 272 | + cmds: |
| 273 | + - task: utility:normalize-path |
| 274 | + vars: |
| 275 | + RAW_PATH: "{{.RAW_PATH}}" |
| 276 | + |
| 277 | + # Print a normalized version of the path passed via the RAW_PATH variable to stdout |
| 278 | + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml |
| 279 | + utility:normalize-path: |
| 280 | + cmds: |
| 281 | + - | |
| 282 | + if [[ "{{.OS}}" == "Windows_NT" ]] && which cygpath &>/dev/null; then |
| 283 | + # Even though the shell handles POSIX format absolute paths as expected, external applications do not. |
| 284 | + # So paths passed to such applications must first be converted to Windows format. |
| 285 | + cygpath -w "{{.RAW_PATH}}" |
| 286 | + else |
| 287 | + echo "{{.RAW_PATH}}" |
| 288 | + fi |
0 commit comments