Files
setup-task/Taskfile.yml

70 lines
1.6 KiB
YAML

version: "3"
tasks:
build:
desc: Build the project
deps:
- task: ts:build
check:
desc: Check for problems with the project
deps:
- task: ts:test
- task: action:validate
- task: general:check-spelling
ts:install-deps:
desc: Install TypeScript development 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"
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