-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathTaskfile.yml
101 lines (87 loc) · 2.4 KB
/
Taskfile.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: "3"
tasks:
build:
desc: Build the project
deps:
- task: ts:build
format:
desc: Format all files
deps:
- task: general:format
check:
desc: Check for problems with the project
deps:
- task: ts:test
- task: action:validate
- task: markdown:lint
- task: general:check-spelling
ts:install-deps:
desc: Install TypeScript dependencies
cmds:
- npm install
ts:build:
desc: Build the action's TypeScript code.
deps:
- task: ts:install-deps
cmds:
- npx tsc
- npx ncc build
ts:test:
desc: Test the action's TypeScript code.
deps:
- task: ts:install-deps
cmds:
- npx jest
ts:lint:
desc: Lint TypeScript code
deps:
- task: ts:install-deps
cmds:
- npx eslint --ext .js,.jsx,.ts,.tsx .
ts:fix-lint:
desc: Fix TypeScript code linting violations
deps:
- task: ts:install-deps
cmds:
- npx eslint --ext .js,.jsx,.ts,.tsx --fix .
action:validate:
desc: Validate GitHub Actions metadata against JSON schema
vars:
ACTION_METADATA_SCHEMA_PATH:
sh: mktemp -t github-action-schema-XXXXXXXXXX.json
cmds:
- wget --quiet --output-document="{{.ACTION_METADATA_SCHEMA_PATH}}" https://json.schemastore.org/github-action
- npx ajv-cli validate --strict=false -s "{{.ACTION_METADATA_SCHEMA_PATH}}" -d "action.yml"
markdown:lint:
desc: Check for problems in Markdown files
cmds:
- npx markdownlint-cli "**/*.md"
markdown:check-links:
desc: Check for broken links
cmds:
- |
# NOTE: npx --call uses the native shell, so this task can't be used on Windows.
npx --package=markdown-link-check --call='
STATUS=0
for file in $(find -name "*.md"); do
markdown-link-check \
--quiet \
--config "./.markdown-link-check.json" \
"$file"
STATUS=$(( $STATUS + $? ))
done
exit $STATUS'
general:format:
desc: Format all supported files with Prettier
cmds:
- npx prettier --write .
general:check-spelling:
desc: Check for commonly misspelled words
cmds:
- poetry install --no-root
- poetry run codespell
general:correct-spelling:
desc: Correct commonly misspelled words where possible
cmds:
- poetry install --no-root
- poetry run codespell --write-changes