-
Notifications
You must be signed in to change notification settings - Fork 583
Expand file tree
/
Copy pathTaskfile.yml
More file actions
68 lines (63 loc) · 2.1 KB
/
Taskfile.yml
File metadata and controls
68 lines (63 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# See: https://taskfile.dev/#/usage
version: "3"
tasks:
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml
general:cache-dep-licenses:
desc: Cache dependency license metadata
deps:
- task: general:check-licensed
- task: general:prepare-deps
cmds:
- licensed cache
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml
general:check-dep-licenses:
desc: Check for unapproved dependency licenses
deps:
- task: general:cache-dep-licenses
cmds:
- |
MATCHES="$(
find \
.licenses \
-regex '.+\.yml' \
-type f \
-print0 \
| \
xargs \
--null \
go tool \
github.com/mikefarah/yq/v4 \
'select(.license == "other") | filename'
)"
if [[ "$MATCHES" != "" ]]; then
printf "%s" "$MATCHES"
echo
echo "The license cache files above have the license set to 'other'. Please manually define the license type and retry."
echo "See: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md#unrecognized-licenses"
exit 1
fi
- licensed status
general:check-licensed:
desc: Install licensed in the .licensed folder
status:
- licensed version
cmds:
- |
if [[ {{OS}} == "windows" ]]; then
echo "Licensed does not have Windows support."
echo "Please use Linux/macOS or download the dependencies cache from the GitHub Actions workflow artifact."
exit 1
fi
- |
echo "Run 'sudo gem install licensed' to install licensed."
exit 1
general:prepare-deps:
desc: Prepare project dependencies for license check
deps:
- task: yarn:install-deps
yarn:install-deps:
desc: |
Install dependencies managed by npm/yarn.
run: when_changed
cmds:
- yarn