Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: adding makefile for common dev commands #1224

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
install-insta:
cargo install --list | grep -q cargo-insta || cargo install cargo-insta

# when adding or modifying ./examples tests, you'll need to run this
review-snapshots: install-insta
cargo insta test --review --test generate_plan_tests

lint:
cargo fmt --all -- --check
cargo check
cargo clippy
cd docs && yarn lint

# run locally to fix all linting errors before pushing
lint-fix:
cargo fmt --all
cargo check
cargo clippy --fix --allow-dirty
cd docs && yarn lint

# where TEST_TARGET=test_python_asdf_poetry, helpful for rerunning failed tests on CI
test-single:
RUST_LOG=DEBUG RUST_BACKTRACE=1 cargo test --package nixpacks --test docker_run_tests -- $(TEST_TARGET) --exact

# ex: TEST_TARGET=examples/python-postgres
build-single:
if [ ! -d "$(TEST_TARGET)" ]; then \
echo "Error: $(TEST_TARGET) is not a valid directory."; \
exit 1; \
fi

RUST_LOG=DEBUG RUST_BACKTRACE=1 cargo run -- build $(TEST_TARGET) --name node

debug-single:
if [ ! -d "$(TEST_TARGET)" ]; then \
echo "Error: $(TEST_TARGET) is not a valid directory."; \
exit 1; \
fi

cargo run -- build $(TEST_TARGET) --out $(TEST_TARGET)
build_debug_cmd="$(shell sed 's/docker build/BUILDX_EXPERIMENTAL=1 docker buildx debug --invoke bash build/' $(TEST_TARGET)/.nixpacks/build.sh)" && \
eval "$$build_debug_cmd"
Loading