File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-taskfiles.md
2
+ name : Check Taskfiles
3
+
4
+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5
+ on :
6
+ push :
7
+ paths :
8
+ - " .github/workflows/check-taskfiles.ya?ml"
9
+ - " **/Taskfile.ya?ml"
10
+ pull_request :
11
+ paths :
12
+ - " .github/workflows/check-taskfiles.ya?ml"
13
+ - " **/Taskfile.ya?ml"
14
+ schedule :
15
+ # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema.
16
+ - cron : " 0 8 * * TUE"
17
+ workflow_dispatch :
18
+ repository_dispatch :
19
+
20
+ jobs :
21
+ validate :
22
+ name : Validate ${{ matrix.file }}
23
+ runs-on : ubuntu-latest
24
+
25
+ strategy :
26
+ fail-fast : false
27
+
28
+ matrix :
29
+ file :
30
+ # TODO: add paths to any additional Taskfiles here
31
+ - ./**/Taskfile.yml
32
+
33
+ steps :
34
+ - name : Checkout repository
35
+ uses : actions/checkout@v2
36
+
37
+ - name : Download JSON schema for Taskfiles
38
+ id : download-schema
39
+ uses :
carlosperate/[email protected]
40
+ with :
41
+ # See: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json
42
+ file-url : https://json.schemastore.org/taskfile.json
43
+ location : ${{ runner.temp }}/taskfile-schema
44
+
45
+ - name : Install JSON schema validator
46
+ run : |
47
+ sudo npm install \
48
+ --global \
49
+ ajv-cli \
50
+ ajv-formats
51
+
52
+ - name : Validate ${{ matrix.file }}
53
+ run : |
54
+ # See: https://github.com/ajv-validator/ajv-cli#readme
55
+ ajv validate \
56
+ --all-errors \
57
+ --strict=false \
58
+ -c ajv-formats \
59
+ -s "${{ steps.download-schema.outputs.file-path }}" \
60
+ -d "${{ matrix.file }}"
You can’t perform that action at this time.
0 commit comments