-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchecks.mk
51 lines (40 loc) · 1.21 KB
/
checks.mk
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
# Invoke with "make -f checks.mk" to run all checks locally
commits := master..HEAD
ifeq ($(shell whoami),docker)
PREFIX :=
SUFFIX :=
else
PREFIX := debpic "
SUFFIX := "
endif
all: black isort mypy pytest package lintian clean
@echo SUCCESS
black:
$(PREFIX) black --check . $(SUFFIX)
isort:
$(PREFIX) isort --check . $(SUFFIX)
mypy:
$(PREFIX) mypy . $(SUFFIX)
pytest:
$(PREFIX) pytest-3 --cov-report=xml --cov $(SUFFIX)
package:
$(PREFIX) dpkg-buildpackage && mv-debs $(SUFFIX)
lintian: package
$(PREFIX) lintian --fail-on warning ./built_packages/*.changes $(SUFFIX)
clean:
$(PREFIX) dpkg-buildpackage --target=clean && \
py3clean . && \
rm -rf .mypy_cache .pytest_cache .coverage coverage.xml $(SUFFIX)
apt-repo: package
$(PREFIX) git diff-index --quiet HEAD -- || (echo Please commit or stash changes && exit -1) && \
rm -rf ~/.aptly && \
aptly repo create -distribution=unstable -component=main debpic && \
aptly repo add debpic ./built_packages && \
aptly publish -architectures=amd64 repo debpic && \
git switch apt-repo && \
rm -r * && \
cp -r ~/.aptly/public/* . && \
git add . && \
git commit -mUpdate && \
git checkout - $(SUFFIX)
echo Now run: git push origin apt-repo:apt-repo