-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
197 lines (165 loc) · 11.9 KB
/
Copy pathMakefile
File metadata and controls
197 lines (165 loc) · 11.9 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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
###########
# Helpers #
###########
# Thanks to Francoise at marmelab.com for this
.DEFAULT_GOAL := help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
print-%:
@echo '$*=$($*)'
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
SED = sed -i
endif
ifeq ($(UNAME), Darwin)
SED = sed -i '' -e
endif
.PHONY: lint fix format test
lint: ## lint this repo
fix: ## fix formatting in this repo
format: fix
test: ## run tests for this repo
.PHONY: update-action-pins check-action-pins
update-action-pins: ## re-pin actions-ext references to each action repo's current main
python3 .github/scripts/update_action_pins.py
check-action-pins: ## check whether any actions-ext pin is out of date
python3 .github/scripts/update_action_pins.py --check
.PHONY: gen-python gen-cpp gen-js gen-jupyter gen-rust gen-rustjswasm gen-cppjswasm gen-uitk-svelte gen-uitk-webawesome gen-site-react gen-site-sveltekit gen-site-webawesome
gen-python: ## regenerate the python template from scratch
mkdir -p ../python-template && cd ../python-template && rm -rf ./* && rm -rf .copier-answers.yaml .gitignore .github .gitattributes
copier copy -w . ../python-template --data-file examples/python.yaml
cd ../python-template && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yaml
.PHONY: gen-cython test-cython
gen-cython: ## regenerate the Cython template
copier copy --defaults --overwrite --vcs-ref=$$(git rev-parse HEAD) . ../python-template-cython --data-file examples/cython.yaml
cd ../python-template-cython && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yaml
test-cython: ## test the generated Cython project
git -C ../python-template-cython init
git -C ../python-template-cython add .
$(MAKE) -C ../python-template-cython develop lint checks coverage dist
gen-cpp: ## regenerate the c++ template from scratch
mkdir -p ../python-template-cpp && cd ../python-template-cpp && rm -rf ./* && rm -rf .copier-answers.yaml .gitignore .github .gitattributes
copier copy -w . ../python-template-cpp --data-file examples/cpp.yaml
cd ../python-template-cpp && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yaml
gen-js: ## regenerate the js template from scratch
mkdir -p ../python-template-js && cd ../python-template-js && rm -rf ./* && rm -rf .copier-answers.yaml .gitignore .github .gitattributes
copier copy -w . ../python-template-js --data-file examples/js.yaml
cd ../python-template-js && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yaml
gen-jupyter: ## regenerate the jupyter template from scratch
mkdir -p ../python-template-jupyter && cd ../python-template-jupyter && rm -rf ./* && rm -rf .copier-answers.yaml .gitignore .github .gitattributes
copier copy -w . ../python-template-jupyter --data-file examples/jupyter.yaml
cd ../python-template-jupyter && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yaml
gen-rust: ## regenerate the rust template from scratch
mkdir -p ../python-template-rust && cd ../python-template-rust && rm -rf ./* && rm -rf .copier-answers.yaml .gitignore .github .gitattributes
copier copy -w . ../python-template-rust --data-file examples/rust.yaml
cd ../python-template-rust && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yaml
gen-rustjswasm: ## regenerate the rustjswasm template from scratch
mkdir -p ../python-template-rustjswasm && cd ../python-template-rustjswasm && rm -rf ./* && rm -rf .copier-answers.yaml .gitignore .github .gitattributes
copier copy -w . ../python-template-rustjswasm --data-file examples/rustjswasm.yaml
cd ../python-template-rustjswasm && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yaml
gen-cppjswasm: ## regenerate the cppjswasm template from scratch
mkdir -p ../python-template-cppjswasm && cd ../python-template-cppjswasm && rm -rf ./* && rm -rf .copier-answers.yaml .gitignore .github .gitattributes
copier copy -w . ../python-template-cppjswasm --data-file examples/cppjswasm.yaml
cd ../python-template-cppjswasm && $(SED) 's#_src_path: .#_src_path: https://github.com/python-project-templates/base.git#g' ./.copier-answers.yaml
gen-uitk-svelte: ## regenerate the Svelte UI toolkit template from scratch
mkdir -p ../javascript-template-uitk-svelte && cd ../javascript-template-uitk-svelte && rm -rf ./* && rm -rf .copier-answers.yaml .github .gitignore .prettierignore .prettierrc .oxfmtrc.json .oxlintrc.json
copier copy -w . ../javascript-template-uitk-svelte --data-file examples/uitk-svelte.yaml
gen-uitk-webawesome: ## regenerate the Lit and Web Awesome UI toolkit template from scratch
mkdir -p ../javascript-template-uitk-webawesome && cd ../javascript-template-uitk-webawesome && rm -rf ./* && rm -rf .copier-answers.yaml .github .gitignore .prettierignore .prettierrc .oxfmtrc.json .oxlintrc.json
copier copy -w . ../javascript-template-uitk-webawesome --data-file examples/uitk-webawesome.yaml
gen-site-react: ## regenerate the React site template from scratch
mkdir -p ../javascript-template-site-react && cd ../javascript-template-site-react && rm -rf ./* && rm -rf .copier-answers.yaml .github .gitignore .oxfmtrc.json .oxlintrc.json
copier copy -w . ../javascript-template-site-react --data-file examples/site-react.yaml
gen-site-sveltekit: ## regenerate the SvelteKit site template from scratch
mkdir -p ../javascript-template-site-sveltekit && cd ../javascript-template-site-sveltekit && rm -rf ./* && rm -rf .copier-answers.yaml .github .gitignore .prettierignore .prettierrc .oxfmtrc.json .oxlintrc.json
copier copy -w . ../javascript-template-site-sveltekit --data-file examples/site-sveltekit.yaml
gen-site-webawesome: ## regenerate the Web Awesome site template from scratch
mkdir -p ../javascript-template-site-webawesome && cd ../javascript-template-site-webawesome && rm -rf ./* && rm -rf .copier-answers.yaml .github .gitignore .prettierignore .prettierrc .oxfmtrc.json .oxlintrc.json
copier copy -w . ../javascript-template-site-webawesome --data-file examples/site-webawesome.yaml
.PHONY: test-python test-cpp test-js test-jupyter test-rust test-rustjswasm test-cppjswasm test-uitk-svelte test-uitk-webawesome test-site-react test-site-sveltekit test-site-webawesome
test-python:
cd ../python-template && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
cd ../python-template && make develop
cd ../python-template && make lint
cd ../python-template && make checks
cd ../python-template && make test
test-cpp:
cd ../python-template-cpp && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
cd ../python-template-cpp && make develop
cd ../python-template-cpp && make lint
cd ../python-template-cpp && make checks
cd ../python-template-cpp && make test
test-js:
cd ../python-template-js && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
cd ../python-template-js && make develop
cd ../python-template-js && git add js/pnpm-lock.yaml && git commit -m "lockfile"
cd ../python-template-js && make lint
cd ../python-template-js && make checks
cd ../python-template-js && make test
test-jupyter:
cd ../python-template-jupyter && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
cd ../python-template-jupyter && make develop
cd ../python-template-jupyter && git add js/pnpm-lock.yaml && git commit -m "lockfile"
cd ../python-template-jupyter && make lint
cd ../python-template-jupyter && make checks
cd ../python-template-jupyter && make test
test-rust:
cd ../python-template-rust && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
cd ../python-template-rust && make develop
cd ../python-template-rust && git add Cargo.lock && git commit -m "lockfile"
cd ../python-template-rust && make lint
cd ../python-template-rust && make checks
cd ../python-template-rust && make test
test-rustjswasm:
cd ../python-template-rustjswasm && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
cd ../python-template-rustjswasm && make develop
cd ../python-template-rustjswasm && git add Cargo.lock && git commit -m "lockfile"
cd ../python-template-rustjswasm && git add js/pnpm-lock.yaml && git commit -m "lockfile"
cd ../python-template-rustjswasm && make lint
cd ../python-template-rustjswasm && make checks
cd ../python-template-rustjswasm && make test
test-cppjswasm:
cd ../python-template-cppjswasm && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
cd ../python-template-cppjswasm && make develop
cd ../python-template-cppjswasm && git add js/pnpm-lock.yaml && git commit -m "lockfile"
cd ../python-template-cppjswasm && make lint
cd ../python-template-cppjswasm && make checks
cd ../python-template-cppjswasm && make test
test-uitk-svelte:
cd ../javascript-template-uitk-svelte && pnpm install
cd ../javascript-template-uitk-svelte && pnpm exec playwright install chromium
cd ../javascript-template-uitk-svelte && pnpm lint
cd ../javascript-template-uitk-svelte && pnpm check
cd ../javascript-template-uitk-svelte && pnpm build
cd ../javascript-template-uitk-svelte && pnpm test:unit
cd ../javascript-template-uitk-svelte && CI=1 pnpm test:e2e
test-uitk-webawesome:
cd ../javascript-template-uitk-webawesome && pnpm install
cd ../javascript-template-uitk-webawesome && pnpm exec playwright install chromium
cd ../javascript-template-uitk-webawesome && pnpm lint
cd ../javascript-template-uitk-webawesome && pnpm check
cd ../javascript-template-uitk-webawesome && pnpm build
cd ../javascript-template-uitk-webawesome && pnpm test:unit
cd ../javascript-template-uitk-webawesome && CI=1 pnpm test:e2e
test-site-react:
cd ../javascript-template-site-react && pnpm install
cd ../javascript-template-site-react && pnpm exec playwright install chromium
cd ../javascript-template-site-react && pnpm lint
cd ../javascript-template-site-react && pnpm check
cd ../javascript-template-site-react && pnpm build
cd ../javascript-template-site-react && pnpm test:unit
cd ../javascript-template-site-react && CI=1 pnpm test:e2e
test-site-sveltekit:
cd ../javascript-template-site-sveltekit && pnpm install
cd ../javascript-template-site-sveltekit && pnpm exec playwright install chromium
cd ../javascript-template-site-sveltekit && pnpm lint
cd ../javascript-template-site-sveltekit && pnpm check
cd ../javascript-template-site-sveltekit && pnpm build
cd ../javascript-template-site-sveltekit && CI=1 pnpm test:e2e
test-site-webawesome:
cd ../javascript-template-site-webawesome && pnpm install
cd ../javascript-template-site-webawesome && pnpm exec playwright install chromium
cd ../javascript-template-site-webawesome && pnpm lint
cd ../javascript-template-site-webawesome && pnpm check
cd ../javascript-template-site-webawesome && pnpm build
cd ../javascript-template-site-webawesome && CI=1 pnpm test:e2e