-
Notifications
You must be signed in to change notification settings - Fork 2
/
Taskfile.yml
113 lines (96 loc) · 2.81 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
102
103
104
105
106
107
108
109
110
111
112
113
---
# https://taskfile.dev
version: '3'
set:
- nounset
- errexit
- pipefail
vars:
PROJECT_SLUG: cookiecutter_python
INPUT_EXCLUDE: .*\{\{.*\}\}.*
PYTHON_VERSION: 3.12
VERSION:
sh: pipenv run python -c 'from {{.PROJECT_SLUG}} import __version__; print(__version__)'
includes:
py:
taskfile: ./goat/Task/python/Taskfile.yml
internal: true
optional: true
vars:
INPUT_EXCLUDE: '{{.INPUT_EXCLUDE}}'
PYTHON_VERSION: '{{.PYTHON_VERSION}}'
VERSION: '{{.VERSION}}'
silent: true
tasks:
init-pipenv:
desc: Initializes the pipenv virtual environment if Pipfile.lock changes
internal: true
sources:
- Pipfile.lock
cmds:
# Clean up any existing pipenv; useful when doing upgrades over time
- pipenv --rm || true
- pipenv install --deploy --ignore-pipfile --dev
init-submodules:
desc: >
Initializes git submodules; paved road projects include the Seiso goat 🐐
for its shared configs, etc.
internal: true
status:
# don't update submodules if you aren't in a git repository; quote to avoid yaml intrepretering the ! as a node tag
# https://yaml.org/spec/1.2.2/#691-node-tags
- '! test -d .git'
cmds:
- git submodule update --init
init-pre-commit:
desc: Install the pre-commit hooks
internal: true
sources:
- .pre-commit-config.yaml
status:
# Don't install the pre-commit hooks if you aren't in a git repository; quote to avoid yaml intrepretering the ! as a node tag
# https://yaml.org/spec/1.2.2/#691-node-tags
- '! test -d .git'
cmds:
# Don't run this in pipelines
- '{{if ne .GITHUB_ACTIONS "true"}}pipenv run pre-commit install{{else}}echo "Detected a github actions pipeline; skipping the pre-commit install"{{end}}'
init:
desc: Initialize the repo for local use; intended to be run after git clone
cmds:
- task: init-pipenv
- task: init-submodules
- task: init-pre-commit
lint:
desc: Run the linter(s); paved road projects use the Seiso goat 🐐
cmds:
- task: py:lint
vars:
INPUT_LOG_LEVEL: "{{.CLI_ARGS}}"
validate:
desc: Validate the pre-commit config and hooks files
cmds:
- task: py:validate
test:
desc: Run the project tests
cmds:
- pipenv run pytest --keep-baked-projects tests
update:
desc: Update the project dev and runtime dependencies, and other misc components
cmds:
- task: py:update
clean:
desc: Clean up build artifacts, cache files/directories, temp files, etc.
cmds:
- task: py:clean
release:
desc: Cut a project release
cmds:
- task: py:release
sbom:
desc: Generate project SBOMs
cmds:
- task: bash:sbom
vulnscan:
desc: Vuln scan the SBOM
cmds:
- task: bash:vulnscan