File tree Expand file tree Collapse file tree 5 files changed +123
-1
lines changed
Expand file tree Collapse file tree 5 files changed +123
-1
lines changed Original file line number Diff line number Diff line change 1+ # Automatically use Nix flakes when entering this directory
2+ # Install direnv and run: direnv allow
3+
4+ use flake
5+
6+ # Optional: Set additional environment variables
7+ # export DATABASE_URL="todo.db"
8+ # export RUST_BACKTRACE="1"
Original file line number Diff line number Diff line change 1+ name : Docker Build
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ branches : [ "main" ]
8+
9+ jobs :
10+ docker-build :
11+ name : Docker Build Test
12+ runs-on : ubuntu-latest
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - name : Set up Docker Buildx
17+ uses : docker/setup-buildx-action@v3
18+
19+ - name : Build Docker image
20+ uses : docker/build-push-action@v5
21+ with :
22+ context : .
23+ push : false
24+ tags : template-rust:test
25+ cache-from : type=gha
26+ cache-to : type=gha,mode=max
27+
28+ - name : Test Docker image
29+ run : |
30+ docker run --rm template-rust:test --version || echo "Version command not available"
31+ docker run --rm template-rust:test --help
32+
33+ docker-compose :
34+ name : Docker Compose Validation
35+ runs-on : ubuntu-latest
36+ steps :
37+ - uses : actions/checkout@v4
38+
39+ - name : Validate docker-compose.yml
40+ run : docker compose config > /dev/null
Original file line number Diff line number Diff line change 1+ # Rust build artifacts
12/target
3+ Cargo.lock.bak
4+
5+ # Database files
26* .db
37* .db- *
8+ * .sqlite
9+ * .sqlite3
10+
11+ # Environment files
412.env
13+ .env. *
14+ ! .envrc
15+
16+ # macOS
517.DS_Store
18+
19+ # IDE
20+ .idea /
21+ * .swp
22+ * .swo
23+ * ~
24+
25+ # Docker data
26+ data /
27+
28+ # Nix
29+ result
30+ result- *
31+ .direnv /
Original file line number Diff line number Diff line change 11# Multi-stage build for minimal final image
2- FROM rust:1.75 -slim as builder
2+ FROM rust:1.83 -slim AS builder
33
44# Install build dependencies
55RUN apt-get update && apt-get install -y \
Original file line number Diff line number Diff line change 1+ .PHONY : help build test clean docker-build docker-run docker-compose-up docker-compose-down
2+
3+ help : # # Show this help message
4+ @echo ' Usage: make [target]'
5+ @echo ' '
6+ @echo ' Available targets:'
7+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
8+
9+ build : # # Build the project in debug mode
10+ cargo build
11+
12+ build-release : # # Build the project in release mode
13+ cargo build --release
14+
15+ test : # # Run all tests
16+ cargo test
17+
18+ test-verbose : # # Run tests with verbose output
19+ cargo test -- --nocapture
20+
21+ clippy : # # Run clippy linter
22+ cargo clippy -- -D warnings
23+
24+ fmt : # # Format code
25+ cargo fmt
26+
27+ fmt-check : # # Check code formatting
28+ cargo fmt --all -- --check
29+
30+ clean : # # Clean build artifacts
31+ cargo clean
32+
33+ docker-build : # # Build Docker image
34+ docker build -t template-rust:latest .
35+
36+ docker-run : # # Run Docker container in TUI mode
37+ docker run --rm -it -v $(PWD ) /data:/app/data template-rust:latest tui
38+
39+ docker-compose-up : # # Start services with docker-compose
40+ docker compose up
41+
42+ docker-compose-down : # # Stop services with docker-compose
43+ docker compose down
44+
45+ docker-compose-dev : # # Start development service with docker-compose
46+ docker compose up dev
47+
48+ all : fmt clippy test build # # Run format, clippy, test, and build
You can’t perform that action at this time.
0 commit comments