File tree Expand file tree Collapse file tree 3 files changed +78
-0
lines changed Expand file tree Collapse file tree 3 files changed +78
-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-workflows-task.md
2
+ name : Check Workflows
3
+
4
+ env :
5
+ # See: https://github.com/actions/setup-node/#readme
6
+ NODE_VERSION : 16.x
7
+
8
+ # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
9
+ on :
10
+ push :
11
+ paths :
12
+ - " .github/workflows/*.ya?ml"
13
+ - " package.json"
14
+ - " package-lock.json"
15
+ - " Taskfile.ya?ml"
16
+ pull_request :
17
+ paths :
18
+ - " .github/workflows/*.ya?ml"
19
+ - " package.json"
20
+ - " package-lock.json"
21
+ - " Taskfile.ya?ml"
22
+ schedule :
23
+ # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema.
24
+ - cron : " 0 8 * * TUE"
25
+ workflow_dispatch :
26
+ repository_dispatch :
27
+
28
+ jobs :
29
+ validate :
30
+ runs-on : ubuntu-latest
31
+
32
+ steps :
33
+ - name : Checkout repository
34
+ uses : actions/checkout@v3
35
+
36
+ - name : Setup Node.js
37
+ uses : actions/setup-node@v3
38
+ with :
39
+ node-version : ${{ env.NODE_VERSION }}
40
+
41
+ - name : Install Task
42
+ uses : arduino/setup-task@v1
43
+ with :
44
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
45
+ version : 3.x
46
+
47
+ - name : Validate workflows
48
+ run : task --silent ci:validate
Original file line number Diff line number Diff line change 10
10
[ ![ Check Python status] ( https://github.com/arduino/compile-sketches/actions/workflows/check-python-task.yml/badge.svg )] ( https://github.com/arduino/compile-sketches/actions/workflows/check-python-task.yml )
11
11
[ ![ Check Taskfiles status] ( https://github.com/arduino/compile-sketches/actions/workflows/check-taskfiles.yml/badge.svg )] ( https://github.com/arduino/compile-sketches/actions/workflows/check-taskfiles.yml )
12
12
[ ![ Check ToC status] ( https://github.com/arduino/compile-sketches/actions/workflows/check-toc-task.yml/badge.svg )] ( https://github.com/arduino/compile-sketches/actions/workflows/check-toc-task.yml )
13
+ [ ![ Check Workflows status] ( https://github.com/arduino/compile-sketches/actions/workflows/check-workflows-task.yml/badge.svg )] ( https://github.com/arduino/compile-sketches/actions/workflows/check-workflows-task.yml )
13
14
[ ![ Spell Check status] ( https://github.com/arduino/compile-sketches/actions/workflows/spell-check-task.yml/badge.svg )] ( https://github.com/arduino/compile-sketches/actions/workflows/spell-check-task.yml )
14
15
[ ![ Sync Labels status] ( https://github.com/arduino/compile-sketches/actions/workflows/sync-labels-npm.yml/badge.svg )] ( https://github.com/arduino/compile-sketches/actions/workflows/sync-labels-npm.yml )
15
16
[ ![ Test Python status] ( https://github.com/arduino/compile-sketches/actions/workflows/test-python-poetry-task.yml/badge.svg )] ( https://github.com/arduino/compile-sketches/actions/workflows/test-python-poetry-task.yml )
Original file line number Diff line number Diff line change 11
11
desc : Check for problems with the project
12
12
deps :
13
13
- task : action:validate
14
+ - task : ci:validate
14
15
- task : general:check-formatting
15
16
- task : general:check-spelling
16
17
- task : markdown:check-links
@@ -53,6 +54,34 @@ tasks:
53
54
-s "{{.ACTION_METADATA_SCHEMA_PATH}}" \
54
55
-d "action.yml"
55
56
57
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml
58
+ ci:validate :
59
+ desc : Validate GitHub Actions workflows against their JSON schema
60
+ vars :
61
+ # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
62
+ WORKFLOW_SCHEMA_URL : https://json.schemastore.org/github-workflow
63
+ WORKFLOW_SCHEMA_PATH :
64
+ sh : task utility:mktemp-file TEMPLATE="workflow-schema-XXXXXXXXXX.json"
65
+ WORKFLOWS_DATA_PATH : " ./.github/workflows/*.{yml,yaml}"
66
+ deps :
67
+ - task : npm:install-deps
68
+ cmds :
69
+ - |
70
+ wget \
71
+ --quiet \
72
+ --output-document="{{.WORKFLOW_SCHEMA_PATH}}" \
73
+ {{.WORKFLOW_SCHEMA_URL}}
74
+ - |
75
+ npx \
76
+ --package=ajv-cli \
77
+ --package=ajv-formats \
78
+ ajv validate \
79
+ --all-errors \
80
+ --strict=false \
81
+ -c ajv-formats \
82
+ -s "{{.WORKFLOW_SCHEMA_PATH}}" \
83
+ -d "{{.WORKFLOWS_DATA_PATH}}"
84
+
56
85
docs:generate :
57
86
desc : Create all generated documentation content
58
87
# This is an "umbrella" task used to call any documentation generation processes the project has.
You can’t perform that action at this time.
0 commit comments