76 lines
2.0 KiB
Makefile
76 lines
2.0 KiB
Makefile
set positional-arguments
|
|
|
|
target := "x86_64-unknown-linux-musl"
|
|
|
|
check: test
|
|
cargo check
|
|
cargo fmt --check
|
|
cargo clippy --no-deps -- -Dwarnings
|
|
|
|
fmt:
|
|
cargo fmt
|
|
git ls-files | grep '\.py$' | xargs black
|
|
|
|
lint:
|
|
cargo clippy --no-deps
|
|
|
|
lint-fix:
|
|
cargo clippy --no-deps --fix
|
|
|
|
release:
|
|
cargo build --release --target {{target}}
|
|
|
|
test-binary-docker:
|
|
env \
|
|
GITHUB_API_BASEURL=http://rest:5000/github \
|
|
GITLAB_API_BASEURL=http://rest:5000/gitlab \
|
|
cargo build --target {{target}} --profile e2e-tests --features=static-build
|
|
|
|
test-binary:
|
|
env \
|
|
GITHUB_API_BASEURL=http://localhost:5000/github \
|
|
GITLAB_API_BASEURL=http://localhost:5000/gitlab \
|
|
cargo build --target {{target}} --profile e2e-tests
|
|
|
|
install:
|
|
cargo install --path .
|
|
|
|
install-static:
|
|
cargo install --target {{target}} --features=static-build --path .
|
|
|
|
test: test-unit test-integration test-e2e
|
|
|
|
test-unit:
|
|
cargo test --lib --bins
|
|
|
|
test-integration:
|
|
cargo test --test "*"
|
|
|
|
test-e2e-docker +tests=".": test-binary-docker
|
|
cd ./e2e_tests \
|
|
&& docker-compose rm --stop -f \
|
|
&& docker-compose build \
|
|
&& docker-compose run \
|
|
--rm \
|
|
-v $PWD/../target/{{target}}/e2e-tests/grm:/grm \
|
|
pytest \
|
|
"GRM_BINARY=/grm python3 ALTERNATE_DOMAIN=alternate-rest -m pytest -p no:cacheprovider --color=yes "$@"" \
|
|
&& docker-compose rm --stop -f
|
|
|
|
test-e2e +tests=".": test-binary
|
|
cd ./e2e_tests \
|
|
&& docker-compose rm --stop -f \
|
|
&& docker-compose build \
|
|
&& docker-compose up -d rest \
|
|
&& GRM_BINARY={{justfile_directory()}}/target/{{target}}/e2e-tests/grm ALTERNATE_DOMAIN=127.0.0.1 python3 -m pytest -p no:cacheprovider --color=yes {{tests}} \
|
|
&& docker-compose rm --stop -f
|
|
|
|
update-dependencies: update-cargo-dependencies
|
|
|
|
update-cargo-dependencies:
|
|
@cd ./depcheck \
|
|
&& python3 -m venv ./venv \
|
|
&& . ./venv/bin/activate \
|
|
&& pip --disable-pip-version-check install -r ./requirements.txt > /dev/null \
|
|
&& ./update-cargo-dependencies.py
|