|
1 | 1 | # See: https://taskfile.dev/#/usage
|
2 | 2 | version: "3"
|
3 | 3 |
|
4 |
| -vars: |
5 |
| - LDFLAGS: |
6 |
| - DEFAULT_GO_MODULE_PATH: .github/workflows/assets/validate-registry/ |
7 |
| - DEFAULT_GO_PACKAGES: |
8 |
| - sh: | |
9 |
| - echo $(cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} && go list ./... | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"') |
10 |
| -
|
11 | 4 | tasks:
|
12 | 5 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml
|
13 | 6 | ci:validate:
|
14 | 7 | desc: Validate GitHub Actions workflows against their JSON schema
|
15 | 8 | vars:
|
|
35 | 28 | -s "{{.WORKFLOW_SCHEMA_PATH}}" \
|
36 | 29 | -d "{{.WORKFLOWS_DATA_PATH}}"
|
37 | 30 |
|
38 | 31 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-general-formatting-task/Taskfile.yml
|
39 | 32 | general:check-formatting:
|
40 | 33 | desc: Check basic formatting style of all files
|
41 | 34 | cmds:
|
|
46 | 39 | fi
|
47 | 40 | - ec
|
48 | 41 |
|
49 | 42 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml
|
50 | 43 | general:format-prettier:
|
51 | 44 | desc: Format all supported files with Prettier
|
52 | 45 | cmds:
|
53 | 46 | - npx prettier --write .
|
54 | 47 |
|
55 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/go-task/Taskfile.yml |
56 |
| - go:build: |
57 |
| - desc: Build the Go code |
58 |
| - dir: "{{.DEFAULT_GO_MODULE_PATH}}" |
59 |
| - cmds: |
60 |
| - - go build -v {{.LDFLAGS}} |
61 |
| - |
62 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml |
63 |
| - go:check: |
64 |
| - desc: Check for problems with Go code |
65 |
| - deps: |
66 |
| - - task: go:vet |
67 |
| - - task: go:lint |
68 |
| - |
69 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml |
70 |
| - go:vet: |
71 |
| - desc: Check for errors in Go code |
72 |
| - dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" |
73 |
| - cmds: |
74 |
| - - go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}} |
75 |
| - |
76 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml |
77 |
| - go:fix: |
78 |
| - desc: Modernize usages of outdated APIs |
79 |
| - dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" |
80 |
| - cmds: |
81 |
| - - go fix {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}} |
82 |
| - |
83 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml |
84 |
| - go:lint: |
85 |
| - desc: Lint Go code |
86 |
| - dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" |
87 |
| - cmds: |
88 |
| - - | |
89 |
| - if ! which golint &>/dev/null; then |
90 |
| - echo "golint not installed or not in PATH. Please install: https://github.com/golang/lint#installation" |
91 |
| - exit 1 |
92 |
| - fi |
93 |
| - - | |
94 |
| - golint \ |
95 |
| - {{default "-min_confidence 0.8 -set_exit_status" .GO_LINT_FLAGS}} \ |
96 |
| - {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}} |
97 |
| -
|
98 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml |
99 |
| - go:format: |
100 |
| - desc: Format Go code |
101 |
| - dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" |
102 |
| - cmds: |
103 |
| - - go fmt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}} |
104 |
| - |
105 |
| - go:tidy: |
106 |
| - desc: Run go mod tidy |
107 |
| - dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}" |
108 |
| - cmds: |
109 |
| - - go mod tidy |
110 |
| - |
111 |
| - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-go-integration-task/Taskfile.yml |
112 |
| - go:test-integration: |
113 |
| - desc: Run integration tests |
114 |
| - dir: "{{.DEFAULT_GO_MODULE_PATH}}" |
115 |
| - deps: |
116 |
| - - task: go:build |
117 |
| - - task: poetry:install-deps |
118 |
| - cmds: |
119 |
| - - poetry run pytest tests |
120 |
| - |
121 | 48 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
|
122 | 49 | poetry:install-deps:
|
123 | 50 | desc: Install dependencies managed by Poetry
|
124 | 51 | cmds:
|
125 | 52 | - poetry install --no-root
|
126 | 53 |
|
127 | 54 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
|
128 | 55 | poetry:update-deps:
|
129 | 56 | desc: Update all dependencies managed by Poetry to their newest versions
|
130 | 57 | cmds:
|
131 | 58 | - poetry update
|
132 | 59 |
|
133 | 60 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
|
134 | 61 | python:lint:
|
135 | 62 | desc: Lint Python code
|
136 | 63 | deps:
|
|
138 | 65 | cmds:
|
139 | 66 | - poetry run flake8 --show-source
|
140 | 67 |
|
141 | 68 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
|
142 | 69 | python:format:
|
143 | 70 | desc: Format Python files
|
144 | 71 | deps:
|
|
151 | 78 | cmds:
|
152 | 79 | - libraries-repository-engine check-registry registry.txt
|
153 | 80 |
|
154 | 81 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
|
155 | 82 | yaml:lint:
|
156 | 83 | desc: Check for problems with YAML files
|
157 | 84 | deps:
|
|
0 commit comments