forked from getsentry/symbolicator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
111 lines (83 loc) · 2.27 KB
/
Makefile
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
SHELL = /bin/bash
export SYMBOLICATOR_PYTHON_VERSION := python3
all: check test
.PHONY: all
check: style lint
.PHONY: check
clean:
cargo clean
rm -rf .venv
.PHONY: clean
# Builds
build:
cargo build
.PHONY: build
release:
cargo build --release --locked
objcopy --only-keep-debug target/release/symbolicator{,.debug}
objcopy --strip-debug --strip-unneeded target/release/symbolicator
objcopy --add-gnu-debuglink target/release/symbolicator{.debug,}
.PHONY: release
# Tests
test: test-rust test-integration
.PHONY: test
test-rust:
cargo test --workspace --all-features --locked
.PHONY: test-rust
test-integration: .venv/bin/python
.venv/bin/pip install -U pytest pytest-localserver requests pytest-xdist pytest-icdiff boto3
cargo build --locked
@.venv/bin/pytest tests/integration -n12 -vv
.PHONY: test-integration
# Documentation
docs: .venv/bin/python
.venv/bin/pip install -U mkdocs mkdocs-material pygments
.venv/bin/mkdocs build
touch site/.nojekyll
.PHONY: docs
docserver: .venv/bin/python
.venv/bin/pip install -U mkdocs mkdocs-material pygments
.venv/bin/mkdocs serve
.PHONY: doc
travis-upload-docs: docs
cd site && zip -r gh-pages .
zeus upload -t "application/zip+docs" site/gh-pages.zip \
|| [[ ! "$(TRAVIS_BRANCH)" =~ ^release/ ]]
.PHONY: travis-upload-docs
# Style checking
style: style-rust style-python
.PHONY: style
style-python: .venv/bin/python
.venv/bin/pip install -U black
.venv/bin/black --check tests
.PHONY: style-python
style-rust:
@rustup component add rustfmt --toolchain stable 2> /dev/null
cargo +stable fmt -- --check
.PHONY: style-rust
# Linting
lint: lint-rust lint-python
.PHONY: lint
lint-python: .venv/bin/python
.venv/bin/pip install -U flake8
.venv/bin/flake8 tests
.PHONY: lint-python
lint-rust:
@rustup component add clippy --toolchain stable 2> /dev/null
cargo +stable clippy --all-features --workspace --tests --examples
.PHONY: lint-rust
# Formatting
format: format-rust format-python
.PHONY: format
format-rust:
@rustup component add rustfmt --toolchain stable 2> /dev/null
cargo +stable fmt
.PHONY: format-rust
format-python: .venv/bin/python
.venv/bin/pip install -U black
.venv/bin/black tests
.PHONY: format-python
# Dependencies
.venv/bin/python: Makefile
rm -rf .venv
$$SYMBOLICATOR_PYTHON_VERSION -m venv .venv