ibis/.woodpecker.yml

26 lines
874 B
YAML
Raw Normal View History

variables:
- &rust_image "rust:1.75"
steps:
2024-02-09 14:45:11 +00:00
cargo_test:
image: *rust_image
environment:
LEMMY_DATABASE_URL: postgres://ibis:password@database:5432/ibis
CARGO_HOME: .cargo_home
commands:
- apt-get update
- apt-get install postgresql sudo -y --no-install-recommends --no-install-suggests
# dbinit (used by tests to create temp db) refuses to run as root so we need to setup another user
- adduser testuser
- cp /usr/local/rustup /home/testuser/.rustup -r
- chown testuser:testuser . -R
- chown testuser:testuser /home/testuser -R
- export PATH="/usr/lib/postgresql/15/bin:/usr/local/cargo/bin:$PATH"
- sudo -u testuser env "PATH=$PATH" cargo test --no-fail-fast
services:
database:
image: postgres:15.2-alpine
environment:
POSTGRES_USER: ibis
POSTGRES_PASSWORD: password