File tree 2 files changed +61
-0
lines changed
2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Source: https://github.com/arduino/tooling-project-assets/blob/master/workflow-templates/check-workflows-task.md
2
+ name : Check Workflows
3
+
4
+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5
+ on :
6
+ push :
7
+ paths :
8
+ - " .github/workflows/*.ya?ml"
9
+ - " Taskfile.ya?ml"
10
+ pull_request :
11
+ paths :
12
+ - " .github/workflows/*.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
+ runs-on : ubuntu-latest
23
+
24
+ steps :
25
+ - name : Checkout repository
26
+ uses : actions/checkout@v2
27
+
28
+ - name : Install Task
29
+ uses : arduino/setup-task@v1
30
+ with :
31
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
32
+ version : 3.x
33
+
34
+ - name : Validate workflows
35
+ run : task --silent ci:validate
Original file line number Diff line number Diff line change 2
2
version : " 3"
3
3
4
4
tasks :
5
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml
6
+ ci:validate :
7
+ desc : Validate GitHub Actions workflows against their JSON schema
8
+ vars :
9
+ # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
10
+ WORKFLOW_SCHEMA_URL : https://json.schemastore.org/github-workflow
11
+ WORKFLOW_SCHEMA_PATH :
12
+ sh : mktemp -t workflow-schema-XXXXXXXXXX.json
13
+ WORKFLOWS_DATA_PATH : " ./.github/workflows/*.{yml,yaml}"
14
+ cmds :
15
+ - |
16
+ wget \
17
+ --quiet \
18
+ --output-document="{{.WORKFLOW_SCHEMA_PATH}}" \
19
+ {{.WORKFLOW_SCHEMA_URL}}
20
+ - |
21
+ npx \
22
+ --package=ajv-cli \
23
+ --package=ajv-formats \
24
+ ajv validate \
25
+ --all-errors \
26
+ --strict=false \
27
+ -c ajv-formats \
28
+ -s "{{.WORKFLOW_SCHEMA_PATH}}" \
29
+ -d "{{.WORKFLOWS_DATA_PATH}}"
30
+
5
31
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-general-formatting-task/Taskfile.yml
6
32
general:check-formatting :
7
33
desc : Check basic formatting style of all files
You can’t perform that action at this time.
0 commit comments