| 1 |
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-workflows-task.md |
| 2 |
name: Check Workflows |
| 3 |
|
| 4 |
# See: https://docs.github.com/actions/reference/workflows-and-actions/events-that-trigger-workflows |
| 5 |
on: |
| 6 |
push: |
| 7 |
paths: |
| 8 |
- ".github/workflows/*.ya?ml" |
| 9 |
- ".npmrc" |
| 10 |
- "go.mod" |
| 11 |
- "go.sum" |
| 12 |
- "package.json" |
| 13 |
- "package-lock.json" |
| 14 |
- "Taskfile.ya?ml" |
| 15 |
pull_request: |
| 16 |
paths: |
| 17 |
- ".github/workflows/*.ya?ml" |
| 18 |
- ".npmrc" |
| 19 |
- "go.mod" |
| 20 |
- "go.sum" |
| 21 |
- "package.json" |
| 22 |
- "package-lock.json" |
| 23 |
- "Taskfile.ya?ml" |
| 24 |
schedule: |
| 25 |
# Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema. |
| 26 |
- cron: "0 8 * * TUE" |
| 27 |
workflow_dispatch: |
| 28 |
repository_dispatch: |
| 29 |
|
| 30 |
jobs: |
| 31 |
validate: |
| 32 |
runs-on: ubuntu-latest |
| 33 |
permissions: |
| 34 |
contents: read |
| 35 |
|
| 36 |
steps: |
| 37 |
- name: Checkout repository |
| 38 |
uses: actions/checkout@v7 |
| 39 |
|
| 40 |
- name: Install Go |
| 41 |
uses: actions/setup-go@v7 |
| 42 |
with: |
| 43 |
go-version-file: go.mod |
| 44 |
|
| 45 |
- name: Setup Node.js |
| 46 |
uses: actions/setup-node@v7 |
| 47 |
with: |
| 48 |
node-version-file: package.json |
| 49 |
|
| 50 |
- name: Validate workflows |
| 51 |
run: | |
| 52 |
go tool \ |
| 53 |
github.com/go-task/task/v3/cmd/task \ |
| 54 |
--silent \ |
| 55 |
ci:validate |