mCaptcha/Makefile

84 lines
2.2 KiB
Makefile
Raw Normal View History

2021-05-03 20:24:03 +05:30
default: frontend
2021-04-08 15:49:55 +05:30
cargo build
2021-07-07 21:10:15 +05:30
clean:
2021-07-15 15:27:01 +05:30
@cargo clean
@yarn cache clean
@-rm -rf browser/pkg
@-rm ./src/cache_buster_data.json
@-rm -rf ./static/cache/bundle
@-rm -rf ./assets
2021-07-07 21:10:15 +05:30
coverage: migrate
cd browser && cargo tarpaulin -t 1200 --out Html
cargo tarpaulin -t 1200 --out Html
2021-04-08 15:49:55 +05:30
dev-env:
cargo fetch
2021-04-09 14:21:43 +05:30
yarn install
2021-10-08 15:57:27 +05:30
cd docs/openapi && yarn install
2021-04-08 15:49:55 +05:30
doc:
#yarn doc
2021-04-08 15:49:55 +05:30
cargo doc --no-deps --workspace --all-features
cd browser && cargo doc --no-deps --workspace --all-features
2021-04-09 15:03:50 +05:30
2021-07-15 15:27:01 +05:30
docker:
2021-07-07 21:10:15 +05:30
docker build -t mcaptcha/mcaptcha:master -t mcaptcha/mcaptcha:latest .
2021-07-15 15:27:01 +05:30
docker-publish:
2021-07-07 21:10:15 +05:30
docker push mcaptcha/mcaptcha:master
docker push mcaptcha/mcaptcha:latest
2021-05-03 20:24:03 +05:30
frontend:
cd browser && wasm-pack build --release
2021-10-08 15:55:53 +05:30
cd docs/openapi/ yarn build
yarn install
2021-04-09 14:21:43 +05:30
yarn build
2021-04-08 15:49:55 +05:30
frontend-test:
cd browser && wasm-pack test --release --headless --chrome
cd browser && wasm-pack test --release --headless --firefox
2021-10-08 15:55:53 +05:30
cd docs/openapi && yarn test
2021-07-09 13:16:54 +05:30
cd browser && cargo test
yarn test
2021-04-08 15:49:55 +05:30
2021-10-08 15:55:53 +05:30
lint:
cargo fmt -v --all -- --emit files
cargo clippy --workspace --tests --all-features
yarn lint
cd docs/openapi && yarn test
2021-07-07 21:10:15 +05:30
migrate:
cargo run --bin tests-migrate
2021-04-08 15:49:55 +05:30
2021-05-03 20:24:03 +05:30
release: frontend
2021-04-08 15:49:55 +05:30
cargo build --release
2021-07-07 21:10:15 +05:30
run: frontend
cargo run
2021-07-09 13:16:54 +05:30
test: frontend-test frontend
2021-07-09 13:57:55 +05:30
echo 'static/' && tree static || true
echo 'tree/' && tree assets || true
2021-07-09 13:16:54 +05:30
cargo test --all-features --no-fail-fast
2021-07-07 21:10:15 +05:30
xml-test-coverage: migrate
cd browser && cargo tarpaulin -t 1200 --out Xml
cargo tarpaulin -t 1200 --out Xml
2021-04-08 15:49:55 +05:30
help:
@echo ' clean - drop builds and environments'
@echo ' coverage - build test coverage in HTML format'
@echo ' dev-env - download dependencies'
2021-07-15 15:27:01 +05:30
@echo ' docker - build docker image'
@echo ' docker-publish - build and publish docker image'
@echo ' doc - build documentation'
2021-05-04 10:30:22 +05:30
@echo ' frontend - build static assets in prod mode'
@echo ' frontend-test - run frontend tests'
2021-07-07 18:20:06 +05:30
@echo ' migrate - run database migrations'
@echo ' run - run developer instance'
@echo ' test - run unit and integration tests'
2021-05-03 20:24:03 +05:30
@echo ' xml-coverage - build test coverage in XML for upload to codecov'
2021-04-08 15:49:55 +05:30
@echo ''