.DEFAULT_GOAL := lint
SHELL := /bin/bash
.PHONY: build
build:
cargo build
.PHONY: lint
lint:
cargo fmt --check
cargo clippy -- -D clippy::all
.PHONY:test
test: test-doc test-unit test-integration
.PHONY: test-doc
test-doc:
cargo test --doc
.PHONY: test-integration
test-integration: integration-tests-env-up tests/.tmp/env
source tests/.tmp/env; cargo test integration
.PHONY: test-unit
test-unit:
cargo test --lib
tests/.tmp/env: tests/.tmp/up/storj-up
$(MAKE) integration-tests-credentials | grep -Ei "^export .+" > tests/.tmp/env
@cd tests; docker compose exec -T satellite-api storj-up credentials --s3 -e \
-a http://authservice:8888 -s satellite-api \
| grep -E 'AWS|STORJ_GATEWAY' >> .tmp/env
.PHONY: integration-tests-credentials
integration-tests-credentials: tests/.tmp/up/storj-up
@cd tests; .tmp/up/storj-up credentials -e
.PHONY: integration-tests-env-up
integration-tests-env-up:
cd tests; docker compose up -d
.PHONY: .integration-tests-env-down
.integration-tests-env-down:
cd tests; docker compose down
tests/.tmp/up/storj-up: tests/.tmp/up
cd tests/.tmp/up; go build -o storj-up
tests/.tmp/up:
mkdir -p tests/.tmp
cd tests/.tmp; git clone https://github.com/storj/up.git
cd tests/.tmp/up; git checkout v1.0.0
.PHONY: publish-test
publish-test:
cargo publish --dry-run -vv
.PHONY: _publish-crate
_publish-crate:
cargo publish
.PHONY: clean
clean: .integration-tests-env-down
rm -rf tests/.tmp
cargo clean