diff --git a/.github/workflows/show-case.yml b/.github/workflows/show-case.yml index 181ec1c..551956d 100644 --- a/.github/workflows/show-case.yml +++ b/.github/workflows/show-case.yml @@ -10,7 +10,7 @@ env: TINYDEW_DB_PATH: /tmp/tinydew-showcase.sqlite jobs: - showcase: + hello-case: runs-on: ubuntu-latest steps: - name: Checkout @@ -22,6 +22,12 @@ jobs: - name: Build run: cargo build + - name: Show Version + run: cargo run -- -V + + - name: Show Help + run: cargo run -- -h + - name: Initial Status run: cargo run -- status @@ -170,11 +176,15 @@ jobs: run: cargo run -- status - name: Clear tile above player run: cargo run -- do clear up + - name: Status after Clear + run: cargo run -- status - name: Plant seed run: cargo run -- do plant up + - name: Status after Plant + run: cargo run -- status - name: Water crop run: cargo run -- do water up - - name: Status after planting and watering + - name: Status after Water run: cargo run -- status # Navigate Farm -> SouthRiver for fishing (each action = 5 min) @@ -200,39 +210,71 @@ jobs: # Fish 17 times to reach 23:55 (each fish = 60 min) - name: Fish 1 run: cargo run -- do fish + - name: Status after Fish 1 + run: cargo run -- status - name: Fish 2 run: cargo run -- do fish + - name: Status after Fish 2 + run: cargo run -- status - name: Fish 3 run: cargo run -- do fish + - name: Status after Fish 3 + run: cargo run -- status - name: Fish 4 run: cargo run -- do fish + - name: Status after Fish 4 + run: cargo run -- status - name: Fish 5 run: cargo run -- do fish + - name: Status after Fish 5 + run: cargo run -- status - name: Fish 6 run: cargo run -- do fish + - name: Status after Fish 6 + run: cargo run -- status - name: Fish 7 run: cargo run -- do fish + - name: Status after Fish 7 + run: cargo run -- status - name: Fish 8 run: cargo run -- do fish + - name: Status after Fish 8 + run: cargo run -- status - name: Fish 9 run: cargo run -- do fish + - name: Status after Fish 9 + run: cargo run -- status - name: Fish 10 run: cargo run -- do fish + - name: Status after Fish 10 + run: cargo run -- status - name: Fish 11 run: cargo run -- do fish + - name: Status after Fish 11 + run: cargo run -- status - name: Fish 12 run: cargo run -- do fish + - name: Status after Fish 12 + run: cargo run -- status - name: Fish 13 run: cargo run -- do fish + - name: Status after Fish 13 + run: cargo run -- status - name: Fish 14 run: cargo run -- do fish + - name: Status after Fish 14 + run: cargo run -- status - name: Fish 15 run: cargo run -- do fish + - name: Status after Fish 15 + run: cargo run -- status - name: Fish 16 run: cargo run -- do fish + - name: Status after Fish 16 + run: cargo run -- status - name: Fish 17 run: cargo run -- do fish - - name: Status before midnight (23:55) + - name: Status after Fish 17 (23:55) run: cargo run -- status # ===== CASE 1: Cross midnight — day increments, day-start does NOT fire ===== @@ -244,14 +286,24 @@ jobs: # ===== CASE 2: Reach 06:00 — day-start fires automatically ===== - name: Fish toward 06:00 (1) run: cargo run -- do fish + - name: Status after Fish toward 06:00 (1) + run: cargo run -- status - name: Fish toward 06:00 (2) run: cargo run -- do fish + - name: Status after Fish toward 06:00 (2) + run: cargo run -- status - name: Fish toward 06:00 (3) run: cargo run -- do fish + - name: Status after Fish toward 06:00 (3) + run: cargo run -- status - name: Fish toward 06:00 (4) run: cargo run -- do fish + - name: Status after Fish toward 06:00 (4) + run: cargo run -- status - name: Fish toward 06:00 (5) run: cargo run -- do fish + - name: Status after Fish toward 06:00 (5) + run: cargo run -- status - name: "CASE 2: Fish crosses 06:00 — day-start fires" run: cargo run -- do fish - name: "CASE 2: Status — day 2 06:55, weather rolled, crop grew, spawns appeared" @@ -275,11 +327,15 @@ jobs: run: cargo run -- do move up - name: Navigate to (3,3) run: cargo run -- do move up + - name: Status back at Farm + run: cargo run -- status - name: Harvest mature crop above run: cargo run -- do harvest up + - name: Status after Harvest + run: cargo run -- status - name: Water crop above run: cargo run -- do water up - - name: "CASE 3: Status before sleep — crop harvested and re-watered" + - name: "CASE 3: Status after Water — crop harvested and re-watered" run: cargo run -- status - name: "CASE 3: Sleep" run: cargo run -- do sleep @@ -369,14 +425,24 @@ jobs: # Day 1 — Buy 5 seeds (start with 1, total 6) - name: Buy Seed 1 run: cargo run -- do buy seed + - name: Status after Buy Seed 1 + run: cargo run -- status - name: Buy Seed 2 run: cargo run -- do buy seed + - name: Status after Buy Seed 2 + run: cargo run -- status - name: Buy Seed 3 run: cargo run -- do buy seed + - name: Status after Buy Seed 3 + run: cargo run -- status - name: Buy Seed 4 run: cargo run -- do buy seed + - name: Status after Buy Seed 4 + run: cargo run -- status - name: Buy Seed 5 run: cargo run -- do buy seed + - name: Status after Buy Seed 5 + run: cargo run -- status # Clear and plant at (4,1) through (4,6) # Player at (3,3), navigate up to (3,1) then work downward @@ -386,36 +452,58 @@ jobs: run: cargo run -- do move up - name: Clear (4,1) run: cargo run -- do clear right + - name: Status after Clear (4,1) + run: cargo run -- status - name: Plant (4,1) run: cargo run -- do plant right + - name: Status after Plant (4,1) + run: cargo run -- status - name: Navigate to (3,2) run: cargo run -- do move down - name: Clear (4,2) run: cargo run -- do clear right + - name: Status after Clear (4,2) + run: cargo run -- status - name: Plant (4,2) run: cargo run -- do plant right + - name: Status after Plant (4,2) + run: cargo run -- status - name: Navigate to (3,3) run: cargo run -- do move down - name: Clear (4,3) run: cargo run -- do clear right + - name: Status after Clear (4,3) + run: cargo run -- status - name: Plant (4,3) run: cargo run -- do plant right + - name: Status after Plant (4,3) + run: cargo run -- status - name: Navigate to (3,4) run: cargo run -- do move down - name: Clear (4,4) run: cargo run -- do clear right + - name: Status after Clear (4,4) + run: cargo run -- status - name: Plant (4,4) run: cargo run -- do plant right + - name: Status after Plant (4,4) + run: cargo run -- status - name: Navigate to (3,5) run: cargo run -- do move down - name: Clear (4,5) run: cargo run -- do clear right + - name: Status after Clear (4,5) + run: cargo run -- status - name: Plant (4,5) run: cargo run -- do plant right + - name: Status after Plant (4,5) + run: cargo run -- status - name: Navigate to (3,6) run: cargo run -- do move down - name: Clear (4,6) run: cargo run -- do clear right + - name: Status after Clear (4,6) + run: cargo run -- status - name: Plant (4,6) run: cargo run -- do plant right - name: "Grow: Status after planting 6 crops" @@ -434,18 +522,24 @@ jobs: run: cargo run -- do move up - name: Water (4,1) run: cargo run -- do water right + - name: Status after Water (4,1) + run: cargo run -- status - name: Navigate to (3,2) run: cargo run -- do move down - name: Navigate to (3,3) run: cargo run -- do move down - name: Water (4,3) run: cargo run -- do water right + - name: Status after Water (4,3) + run: cargo run -- status - name: Navigate to (3,4) run: cargo run -- do move down - name: Navigate to (3,5) run: cargo run -- do move down - name: Water (4,5) run: cargo run -- do water right + - name: Status after Water (4,5) + run: cargo run -- status # Sleep to next day - name: "Grow: Sleep to Day 2" diff --git a/Cargo.toml b/Cargo.toml index 85d66b7..4d1e033 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tinydew" -version = "0.1.1" +version = "0.1.2" edition = "2024" license = "MIT" diff --git a/agents/ci.spec.md b/agents/ci.spec.md index 669be3b..ac5ed35 100644 --- a/agents/ci.spec.md +++ b/agents/ci.spec.md @@ -22,7 +22,7 @@ Implemented. 2. Install stable Rust toolchain (`dtolnay/rust-toolchain@stable`). 3. `cargo test initial_farm_ui -- --nocapture` — run the farm UI regression test with visible output. -### Showcase (`show-case.yml`) +### Showcase (`show-case.yml`) — `hello-case` job - **Trigger**: Push to any branch, PR to `main`. - **Runner**: `ubuntu-latest`. - **Purpose**: Demonstrate all CLI actions and print the game status after each one as a showcase. @@ -30,9 +30,12 @@ Implemented. 1. Checkout (`actions/checkout@v4`). 2. Install stable Rust toolchain (`dtolnay/rust-toolchain@stable`). 3. `cargo build` — compile the project. - 4. Print initial status: + 4. Show version and help: + - `cargo run -- -V` — print version from Cargo.toml. + - `cargo run -- -h` — print help information. + 5. Print initial status: - `cargo run -- status` - 5. Run each action followed by `cargo run -- status` to show the result: + 6. Run each action followed by `cargo run -- status` to show the result: **Basic actions at Farm (start at (3,3)):** - `cargo run -- do move down` → `cargo run -- status` - `cargo run -- do move left` → `cargo run -- status` @@ -78,7 +81,19 @@ Implemented. - `cargo run -- status` *(back at Farm)* **Sleep and day transition:** - `cargo run -- do sleep` → `cargo run -- status` *(show day 2 state)* - 6. Each step uses a descriptive `name` label (e.g., "Move Down", "Status after Move Down", "Navigate to Square", "Status at SouthRiver") for readable CI output. + 7. Each step uses a descriptive `name` label (e.g., "Move Down", "Status after Move Down", "Navigate to Square", "Status at SouthRiver") for readable CI output. + +### Showcase — Day Transition (`day-transition-cases` job) +- **Purpose**: Verify day-transition mechanics: midnight crossing, 06:00 day-start trigger, and sleep. +- **DB**: `/tmp/tinydew-cases.sqlite` (isolated). +- **Steps**: + 1. Build the project. + 2. Setup: clear, plant, and water a crop on Day 1, showing status after each action. + 3. Navigate Farm → SouthRiver. Show status at destination. + 4. Fish 17 times to reach 23:55, showing status after each fish. + 5. **CASE 1**: Fish once to cross midnight → show status (day 2 00:55, no day-start effects). + 6. **CASE 2**: Fish 5 more times with status after each, then fish once more to cross 06:00 → show status (day-start fires: weather, crop growth, spawns). + 7. **CASE 3**: Navigate back to Farm (show status at destination), harvest (show status), water (show status), sleep → show status (day 3 06:00). ### Showcase — Regions (`regions-showcase` job) - **Purpose**: Demonstrate region traversal across all four regions in a single run. @@ -95,9 +110,9 @@ Implemented. - **DB**: `/tmp/tinydew-grow.sqlite` (isolated). - **Steps**: 1. Build the project. - 2. Buy 5 seeds (start with 1 → total 6). - 3. Navigate along column x=3 from y=1 to y=6, clearing and planting at (4,1), (4,2), (4,3), (4,4), (4,5), (4,6). Show status. - 4. Navigate back and water only (4,1), (4,3), (4,5) — skip (4,2), (4,4), (4,6). + 2. Buy 5 seeds (start with 1 → total 6), showing status after each purchase. + 3. Navigate along column x=3 from y=1 to y=6, clearing and planting at (4,1), (4,2), (4,3), (4,4), (4,5), (4,6), showing status after each clear and plant action. + 4. Navigate back and water only (4,1), (4,3), (4,5) — skip (4,2), (4,4), (4,6), showing status after each water action. 5. Sleep to Day 2. Show status — watered crops matured, unwatered crops remain seedlings. ## Notes diff --git a/src/main.rs b/src/main.rs index b52a508..e494327 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ fn main() { match args[1].as_str() { "-h" | "--help" => print_help(), - "-V" | "--version" => println!("tinydew 0.1.0"), + "-V" | "--version" => println!("tinydew {}", env!("CARGO_PKG_VERSION")), "status" => { let state = tinydew::db::load_or_create(); tinydew::ui::render_status(&state);