Skip to content

Commit

Permalink
Add Makefile to make testing and publishing easier
Browse files Browse the repository at this point in the history
  • Loading branch information
JamyGolden committed Feb 8, 2024
1 parent 2a35f17 commit ea29da5
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
publish: publish_dry
@echo "---------------"
@echo "Running publish"
@echo "---------------"
cargo publish

publish_dry: test_docker
@echo "-------------------"
@echo "Running publish_dry"
@echo "-------------------"
@if [ -n "$(git status --porcelain)" ]; then \
echo "There are changes." && exit 1; \
fi
cargo publish --dry-run

test_docker: setup_tests
@echo "-------------------"
@echo "Running test_docker"
@echo "-------------------"
docker build -t tinty . && docker run tinty

test: setup_tests
@echo "------------"
@echo "Running test"
@echo "------------"
RUST_TEST_THREADS=1 cargo test

setup_tests: build
@echo "-----------------"
@echo "Creating fixtures"
@echo "-----------------"
./scripts/create_fixtures

build:
@echo "-------------"
@echo "Running build"
@echo "-------------"
cargo build --release

0 comments on commit ea29da5

Please sign in to comment.