diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cd0fe3..d73b8a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ env: jobs: ci: - name: Check / Test / Build + name: Check / Test runs-on: ubuntu-latest steps: @@ -38,5 +38,27 @@ jobs: - name: test run: cargo test + release-build: + name: Release build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + needs: ci + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-release- + - name: build (release) run: cargo build --release -p presentation -p worker diff --git a/README.md b/README.md index 88073d8..380279b 100644 --- a/README.md +++ b/README.md @@ -153,9 +153,12 @@ Supports review logging, bulk CSV import (column order matches the export format ## Test ```bash -cargo test +cargo test # full workspace (requires DATABASE_URL for sqlx offline checks) +cargo test -p application # domain-level unit tests only — no database required ``` +The `application` crate has unit tests for core use cases (`log_review`, `register`, `login`, `add_to_watchlist`, `delete_review`) backed by in-memory fakes from `domain`'s `test-helpers` feature. These run without a database and are the fastest feedback loop for business logic changes. + ## Docker The image contains both `presentation` (HTTP server) and `worker` (event processor). Run them as separate containers sharing the same data volume: