Skip to content

Commit 4084993

Browse files
authored
Merge pull request #37 from per1234/convenience-tasks
Add convenience tasks to taskfile
2 parents 1994c62 + 9e4bf3c commit 4084993

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

.github/workflows/check-taskfiles.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Check Taskfiles
2+
3+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
paths:
7+
- ".github/workflows/check-taskfiles.ya?ml"
8+
- "**/Taskfile.ya?ml"
9+
pull_request:
10+
paths:
11+
- ".github/workflows/check-taskfiles.ya?ml"
12+
- "**/Taskfile.ya?ml"
13+
schedule:
14+
# Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema.
15+
- cron: "0 8 * * TUE"
16+
workflow_dispatch:
17+
repository_dispatch:
18+
19+
jobs:
20+
validate:
21+
name: Validate ${{ matrix.file }}
22+
runs-on: ubuntu-latest
23+
24+
strategy:
25+
fail-fast: false
26+
27+
matrix:
28+
file:
29+
- ./Taskfile.yml
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v2
34+
35+
- name: Download JSON schema for Taskfiles
36+
id: download-schema
37+
uses: carlosperate/download-file-action@v1.0.3
38+
with:
39+
# See: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json
40+
file-url: https://json.schemastore.org/taskfile.json
41+
location: ${{ runner.temp }}/taskfile-schema
42+
file-name: taskfile.json
43+
44+
- name: Install JSON schema validator
45+
run: sudo npm install --global ajv-cli
46+
47+
- name: Validate ${{ matrix.file }}
48+
run: |
49+
# See: https://github.com/ajv-validator/ajv-cli#readme
50+
ajv validate \
51+
--strict=false \
52+
-s "${{ steps.download-schema.outputs.file-path }}" \
53+
-d "${{ matrix.file }}"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Test Go status](https://github.com/arduino/libraries-repository-engine/actions/workflows/test-go.yml/badge.svg)](https://github.com/arduino/libraries-repository-engine/actions/workflows/test-go.yml)
44
[![Check Go status](https://github.com/arduino/libraries-repository-engine/actions/workflows/check-go.yml/badge.svg)](https://github.com/arduino/libraries-repository-engine/actions/workflows/check-go.yml)
55
[![Check Prettier Formatting status](https://github.com/arduino/libraries-repository-engine/actions/workflows/check-prettier-formatting-task.yml/badge.svg)](https://github.com/arduino/libraries-repository-engine/actions/workflows/check-prettier-formatting-task.yml)
6+
[![Check Taskfiles status](https://github.com/arduino/libraries-repository-engine/actions/workflows/check-taskfiles.yml/badge.svg)](https://github.com/arduino/libraries-repository-engine/actions/workflows/check-taskfiles.yml)
67
[![Spell Check status](https://github.com/arduino/libraries-repository-engine/actions/workflows/spell-check-task.yml/badge.svg)](https://github.com/arduino/libraries-repository-engine/actions/workflows/spell-check-task.yml)
78
[![Check License status](https://github.com/arduino/libraries-repository-engine/actions/workflows/check-license.yml/badge.svg)](https://github.com/arduino/libraries-repository-engine/actions/workflows/check-license.yml)
89

Taskfile.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ vars:
66
sh: echo $(go list ./... | tr '\n' ' ')
77

88
tasks:
9+
build:
10+
desc: Build the project
11+
deps:
12+
- task: go:build
13+
14+
check:
15+
desc: Check for problems with the project
16+
deps:
17+
- task: general:check-spelling
18+
- task: go:lint
19+
- task: go:test
20+
- task: go:vet
21+
22+
format:
23+
desc: Correct the formatting of the project's files
24+
deps:
25+
- task: general:format-prettier
26+
- task: go:format
27+
928
go:build:
1029
desc: Build the project
1130
cmds:

0 commit comments

Comments
 (0)