2024-01-26 13:21:59 +00:00
|
|
|
variables:
|
2024-10-02 12:47:44 +00:00
|
|
|
- &rust_image "rust:1.81"
|
2024-03-29 13:47:53 +00:00
|
|
|
- &install_binstall "wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz && tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz && cp cargo-binstall /usr/local/cargo/bin"
|
2024-12-09 11:51:23 +00:00
|
|
|
- &install_cargo_leptos "cargo-binstall -y cargo-leptos@0.2.24"
|
2024-01-26 13:21:59 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
cargo_fmt:
|
2024-03-05 15:38:07 +00:00
|
|
|
image: rustlang/rust:nightly
|
2024-01-26 13:21:59 +00:00
|
|
|
environment:
|
|
|
|
# store cargo data in repo folder so that it gets cached between steps
|
|
|
|
CARGO_HOME: .cargo_home
|
|
|
|
commands:
|
|
|
|
- rustup component add rustfmt
|
2024-03-05 15:38:07 +00:00
|
|
|
- cargo +nightly fmt -- --check
|
|
|
|
|
2024-03-29 13:42:06 +00:00
|
|
|
leptos_fmt:
|
|
|
|
image: *rust_image
|
|
|
|
commands:
|
|
|
|
- *install_binstall
|
|
|
|
- cargo binstall -y leptosfmt
|
|
|
|
- leptosfmt -c .leptosfmt.toml --check src
|
|
|
|
|
|
|
|
toml_fmt:
|
2024-12-09 11:51:23 +00:00
|
|
|
image: tamasfe/taplo:0.9.3
|
2024-03-29 13:42:06 +00:00
|
|
|
commands:
|
|
|
|
- taplo format --check
|
2024-01-26 13:21:59 +00:00
|
|
|
|
2024-03-06 16:03:10 +00:00
|
|
|
ignored_files:
|
|
|
|
image: alpine:3
|
|
|
|
commands:
|
|
|
|
- apk add git
|
|
|
|
- IGNORED=$(git ls-files --cached -i --exclude-standard)
|
|
|
|
- if [[ "$IGNORED" ]]; then echo "Ignored files present:\n$IGNORED\n"; exit 1; fi
|
|
|
|
|
2024-10-31 10:12:16 +00:00
|
|
|
cargo_shear:
|
|
|
|
image: *rust_image
|
|
|
|
commands:
|
|
|
|
- *install_binstall
|
|
|
|
- cargo binstall -y cargo-shear
|
|
|
|
- cargo shear
|
|
|
|
|
2024-01-26 13:21:59 +00:00
|
|
|
check_diesel_schema:
|
|
|
|
image: willsquire/diesel-cli
|
|
|
|
environment:
|
|
|
|
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
|
2024-02-07 15:54:43 +00:00
|
|
|
|
2024-01-26 13:21:59 +00:00
|
|
|
cargo_clippy:
|
|
|
|
image: *rust_image
|
|
|
|
environment:
|
|
|
|
CARGO_HOME: .cargo_home
|
|
|
|
commands:
|
|
|
|
- rustup component add clippy
|
|
|
|
- cargo clippy --tests --all-targets --all-features
|
|
|
|
|
2024-12-09 11:51:23 +00:00
|
|
|
check_config_defaults_updated:
|
|
|
|
image: *rust_image
|
|
|
|
environment:
|
|
|
|
CARGO_HOME: .cargo_home
|
|
|
|
commands:
|
|
|
|
- cargo run -- --print-config > config/defaults_current.toml
|
|
|
|
- diff config/defaults.toml config/defaults_current.toml
|
|
|
|
|
2024-01-26 13:21:59 +00:00
|
|
|
cargo_test:
|
|
|
|
image: *rust_image
|
|
|
|
environment:
|
|
|
|
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"
|
2024-12-09 11:51:23 +00:00
|
|
|
- sudo -u testuser env "PATH=$PATH" "CARGO_HOME=$CARGO_HOME" cargo test --no-fail-fast
|
2024-01-26 13:21:59 +00:00
|
|
|
|
2024-03-06 16:03:10 +00:00
|
|
|
build_release:
|
|
|
|
image: *rust_image
|
|
|
|
environment:
|
|
|
|
CARGO_HOME: .cargo_home
|
|
|
|
commands:
|
2024-12-10 14:16:14 +00:00
|
|
|
- apt-get update
|
|
|
|
- apt-get install npm -y --no-install-recommends --no-install-suggests
|
|
|
|
- npm install
|
2024-10-16 10:27:52 +00:00
|
|
|
- *install_binstall
|
2024-03-06 16:03:10 +00:00
|
|
|
- rustup target add wasm32-unknown-unknown
|
2024-10-29 08:29:46 +00:00
|
|
|
- *install_cargo_leptos
|
2024-03-08 13:55:55 +00:00
|
|
|
- export PATH="$PATH:$(pwd)/.cargo_home/bin/"
|
|
|
|
- ./scripts/build_release.sh
|
2024-03-06 16:03:10 +00:00
|
|
|
when:
|
2024-04-02 09:43:45 +00:00
|
|
|
- event: tag
|
2024-03-06 16:03:10 +00:00
|
|
|
|
|
|
|
publish_release:
|
2024-10-15 13:20:32 +00:00
|
|
|
image: woodpeckerci/plugin-release
|
2024-03-06 16:03:10 +00:00
|
|
|
settings:
|
|
|
|
files:
|
|
|
|
- ibis.gz
|
|
|
|
title: ${CI_COMMIT_TAG##v}
|
|
|
|
api-key:
|
|
|
|
from_secret: github_token
|
|
|
|
when:
|
2024-04-02 09:43:45 +00:00
|
|
|
- event: tag
|
2024-03-06 16:03:10 +00:00
|
|
|
|
2024-01-26 13:21:59 +00:00
|
|
|
services:
|
|
|
|
database:
|
2024-12-09 11:51:23 +00:00
|
|
|
image: postgres:16-alpine
|
2024-01-26 13:21:59 +00:00
|
|
|
environment:
|
|
|
|
POSTGRES_USER: ibis
|
2024-04-02 09:43:45 +00:00
|
|
|
POSTGRES_PASSWORD: password
|