-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
102 lines (84 loc) · 2.82 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
95
96
97
98
99
100
101
readme:
cargo readme > README.md
clean:
cargo clean
find . -type f -name "*.orig" -exec rm {} \;
find . -type f -name "*.bk" -exec rm {} \;
find . -type f -name ".*~" -exec rm {} \;
lint:
cargo clippy
build:
cargo build
graphql:
graphql-client introspect-schema https://gitlab.com/api/graphql > src/graphql/schema.json
check:
cargo check
# check tests for errors
check-test:
cargo check --tests
# print diff of what fmt would do to the codebase
fmt-check:
cargo fmt -- --check
unit-tests:
cargo test config_unit_tests -- --test-threads=1 --skip integration
cargo test -- --skip config_unit_tests --test-threads=1 --skip integration
int-tests:
cargo test config_unit_tests -- --test-threads=1 --skip unit
cargo test -- --skip config_unit_tests --test-threads=1 --skip unit
all-tests:
cargo test config_unit_tests -- --test-threads=1
cargo test -- --skip config_unit_tests --test-threads=1
test TEST:
cargo test {{TEST}} -- --test-threads=1 --show-output
tarp:
cargo tarpaulin
branch := `git rev-parse --abbrev-ref HEAD`
last_tag := `git tag --sort=v:refname | tail -1`
cargo_ver := `grep version Cargo.toml | head -1 | awk '{print $3}' | sed 's/"//g'`
pwd := `pwd`
bump-major:
test {{branch}} == "master"
test {{last_tag}} == {{cargo_ver}}
cargo bump major
cargo update
cargo readme > README.md
git add Cargo.lock Cargo.toml README.md
git commit -m "rel: $(grep version Cargo.toml | head -1 | awk '{print $3}' | sed 's/\"//g')"
git tag $(grep version Cargo.toml | head -1 | awk '{print $3}' | sed 's/\"//g')
./ci/changelog.sh > CHANGELOG.md
git add CHANGELOG.md
git commit -m "docs: update CHANGELOG.md"
git push; git push --tags
bump-minor:
test {{branch}} == "master"
test {{last_tag}} == {{cargo_ver}}
cargo bump minor
cargo update
cargo readme > README.md
git add Cargo.lock Cargo.toml README.md
git commit -m "rel: $(grep version Cargo.toml | head -1 | awk '{print $3}' | sed 's/\"//g')"
git tag $(grep version Cargo.toml | head -1 | awk '{print $3}' | sed 's/\"//g')
./ci/changelog.sh > CHANGELOG.md
git add CHANGELOG.md
git commit -m "docs: update CHANGELOG.md"
git push; git push --tags
bump-patch:
test {{branch}} == "master"
test {{last_tag}} == {{cargo_ver}}
cargo bump patch
cargo update
cargo readme > README.md
git add Cargo.lock Cargo.toml README.md
git commit -m "rel: $(grep version Cargo.toml | head -1 | awk '{print $3}' | sed 's/\"//g')"
git tag $(grep version Cargo.toml | head -1 | awk '{print $3}' | sed 's/\"//g')
./ci/changelog.sh > CHANGELOG.md
git add CHANGELOG.md
git commit -m "docs: update CHANGELOG.md"
git push; git push --tags
musl:
docker run -it --rm \
-v {{pwd}}:/workdir \
-v ~/.cargo/git:/root/.cargo/git \
-v ~/.cargo/registry:/root/.cargo/registry \
registry.gitlab.com/rust_musl_docker/image:stable-latest \
cargo build --release --target=x86_64-unknown-linux-musl