ci(test): split into unit (no DB) and integration (postgres) jobs
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 5m9s
test / unit (pull_request) Successful in 15m59s
test / integration (pull_request) Failing after 16m59s
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 5m9s
test / unit (pull_request) Successful in 15m59s
test / integration (pull_request) Failing after 16m59s
This commit is contained in:
@@ -6,9 +6,25 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
# Unit tests — no database required.
|
||||||
|
# All business logic is tested via TestStore (in-memory port implementations).
|
||||||
|
unit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: unit tests
|
||||||
|
run: |
|
||||||
|
cargo test --workspace \
|
||||||
|
--exclude postgres \
|
||||||
|
--exclude postgres-federation \
|
||||||
|
--exclude postgres-search
|
||||||
|
|
||||||
|
# Integration tests — require a real PostgreSQL instance.
|
||||||
|
# These test that the SQL queries in the adapter crates are correct.
|
||||||
|
integration:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
@@ -22,16 +38,15 @@ jobs:
|
|||||||
--health-retries 5
|
--health-retries 5
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/thoughts_test
|
DATABASE_URL: postgres://postgres:postgres@localhost:5432/thoughts_test
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: integration tests
|
||||||
- name: test
|
run: |
|
||||||
run: cargo test --workspace
|
cargo test \
|
||||||
|
-p postgres \
|
||||||
|
-p postgres-federation \
|
||||||
|
-p postgres-search
|
||||||
|
|||||||
Reference in New Issue
Block a user