mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-26 14:11:09 +00:00
63 lines
No EOL
1.8 KiB
YAML
63 lines
No EOL
1.8 KiB
YAML
variables:
|
|
- &rust_image "rust:1.75"
|
|
|
|
steps:
|
|
cargo_test:
|
|
image: *rust_image
|
|
environment:
|
|
LEMMY_DATABASE_URL: postgres://ibis:password@database:5432/ibis
|
|
CARGO_HOME: .cargo_home
|
|
commands:
|
|
- which cargo
|
|
- apt-get update
|
|
- apt-get install postgresql sudo -y --no-install-recommends --no-install-suggests
|
|
- adduser testuser
|
|
- cp -r /usr/local/cargo/bin .
|
|
- chown testuser:testuser . -R
|
|
- pwd
|
|
- export PATH="/usr/lib/postgresql/15/bin:/usr/local/cargo/bin:$PATH"
|
|
- ls -la bin
|
|
- sudo -u testuser env "PATH=$PATH" env | /bin/grep PATH
|
|
- sudo -u testuser env "PATH=$PATH" cargo test --no-fail-fast
|
|
|
|
cargo_fmt:
|
|
image: *rust_image
|
|
environment:
|
|
# store cargo data in repo folder so that it gets cached between steps
|
|
CARGO_HOME: .cargo_home
|
|
commands:
|
|
- rustup component add rustfmt
|
|
- cargo fmt -- --check
|
|
|
|
frontend_wasm_build:
|
|
image: *rust_image
|
|
environment:
|
|
CARGO_HOME: .cargo_home
|
|
commands:
|
|
- "rustup target add wasm32-unknown-unknown"
|
|
- "cargo check --target wasm32-unknown-unknown --features csr,hydrate --no-default-features"
|
|
|
|
check_diesel_schema:
|
|
image: willsquire/diesel-cli
|
|
environment:
|
|
CARGO_HOME: .cargo_home
|
|
DATABASE_URL: postgres://ibis:password@database:5432/ibis
|
|
commands:
|
|
- diesel migration run
|
|
- diesel print-schema --config-file=diesel.toml > tmp.schema
|
|
- diff tmp.schema src/backend/database/schema.rs
|
|
|
|
cargo_clippy:
|
|
image: *rust_image
|
|
environment:
|
|
CARGO_HOME: .cargo_home
|
|
commands:
|
|
- rustup component add clippy
|
|
- cargo clippy --tests --all-targets --all-features
|
|
|
|
services:
|
|
database:
|
|
image: postgres:15.2-alpine
|
|
environment:
|
|
POSTGRES_USER: ibis
|
|
POSTGRES_PASSWORD: password |