forked from hakoerber/git-repo-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
94 lines (69 loc) · 2.31 KB
/
Justfile
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
set positional-arguments
set shell := ["/bin/bash", "-c"]
static_target := "x86_64-unknown-linux-musl"
cargo := "cargo"
check: fmt-check lint test
{{cargo}} check
clean:
{{cargo}} clean
git clean -f -d -X
fmt:
{{cargo}} fmt
git ls-files | grep '\.py$' | xargs isort
git ls-files | grep '\.py$' | xargs black
git ls-files | grep '\.sh$' | xargs -L 1 shfmt --indent 4 --write
fmt-check:
{{cargo}} fmt --check
git ls-files | grep '\.py$' | xargs black --check
git ls-files | grep '\.sh$' | xargs -L 1 shfmt --indent 4 --diff
lint:
{{cargo}} clippy --no-deps -- -Dwarnings
git ls-files | grep '\.py$' | xargs ruff check --ignore E501
git ls-files | grep '\.sh$' | xargs -L 1 shellcheck --norc
lint-fix:
{{cargo}} clippy --no-deps --fix
build-release:
{{cargo}} build --release
build-release-static:
{{cargo}} build --release --target {{static_target}} --features=static-build
pushall:
for r in $(git remote) ; do \
for branch in develop master ; do \
git push $r $branch ; \
done ; \
done
release-patch:
./release.sh patch
test-binary:
env \
GITHUB_API_BASEURL=http://rest:5000/github \
GITLAB_API_BASEURL=http://rest:5000/gitlab \
{{cargo}} build --profile e2e-tests --target {{static_target}} --features=static-build
install:
{{cargo}} install --path .
install-static:
{{cargo}} install --target {{static_target}} --features=static-build --path .
build:
{{cargo}} build
build-static:
{{cargo}} build --target {{static_target}} --features=static-build
test: test-unit test-integration test-e2e
test-unit +tests="":
{{cargo}} test --lib --bins -- --show-output {{tests}}
test-integration:
{{cargo}} test --test "*"
test-e2e +tests=".": test-binary
cd ./e2e_tests \
&& docker compose rm --stop -f \
&& docker compose build \
&& docker compose run \
--rm \
-v $PWD/../target/x86_64-unknown-linux-musl/e2e-tests/grm:/grm \
pytest \
"GRM_BINARY=/grm ALTERNATE_DOMAIN=alternate-rest python3 -m pytest --exitfirst -p no:cacheprovider --color=yes "$@"" \
&& docker compose rm --stop -f
update-dependencies: update-cargo-dependencies
update-cargo-dependencies:
./update-cargo-dependencies.py
wait:
read -p "[ENTER] to continue "