732f514da7
We add clippy as our build — also rectifying the missing `plume-cli` build! In the next step we follow clippy's advise and fix some of the "simple" mistakes in our code, such as style or map usage. Finally, we refactor some hard bits that need extraction of new types, or refactoring of function call-types, especially those that thread thru macros, and, of course functions with ~15 parameters should probably be rethought.
80 lines
2.7 KiB
YAML
80 lines
2.7 KiB
YAML
language: rust
|
|
rust:
|
|
- nightly-2018-12-06
|
|
cache:
|
|
cargo: true
|
|
directories:
|
|
- kcov-master
|
|
sudo: true
|
|
dist: trusty
|
|
services: postgres
|
|
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- libcurl4-openssl-dev
|
|
- libelf-dev
|
|
- libdw-dev
|
|
- cmake
|
|
- gcc
|
|
- binutils-dev
|
|
- zlib1g-dev
|
|
- libiberty-dev
|
|
stages:
|
|
- build
|
|
- test and coverage
|
|
jobs:
|
|
include:
|
|
- stage: build
|
|
name: "Build front"
|
|
script: (cargo web -h || cargo install cargo-web) && cd plume-front && cargo clippy -- -D warnings && cargo web check
|
|
before_script: rustup component add clippy
|
|
|
|
- stage: build
|
|
name: "Build with postgresql"
|
|
env:
|
|
- MIGRATION_DIR=migrations/postgres FEATURES=postgres DATABASE_URL=postgres://postgres@localhost/plume
|
|
script: cargo clippy --no-default-features --features="${FEATURES}" --release -- -D warnings
|
|
before_script: rustup component add clippy
|
|
|
|
- stage: build
|
|
name: "Build CLI with postgresql"
|
|
env:
|
|
- MIGRATION_DIR=migrations/postgres FEATURES=postgres DATABASE_URL=postgres://postgres@localhost/plume
|
|
script: cd plume-cli && cargo clippy --no-default-features --features="${FEATURES}" --release -- -D warnings
|
|
before_script: rustup component add clippy
|
|
- stage: build
|
|
name: "Build with sqlite"
|
|
env:
|
|
- MIGRATION_DIR=migrations/sqlite FEATURES=sqlite DATABASE_URL=plume.sqlite3
|
|
script: cargo clippy --no-default-features --features="${FEATURES}" --release -- -D warnings
|
|
before_script: rustup component add clippy
|
|
|
|
- stage: build
|
|
name: "Build CLI with sqlite"
|
|
env:
|
|
- MIGRATION_DIR=migrations/sqlite FEATURES=sqlite DATABASE_URL=plume.sqlite3
|
|
script: cd plume-cli && cargo clippy --no-default-features --features="${FEATURES}" --release -- -D warnings
|
|
before_script: rustup component add clippy
|
|
|
|
- stage: test and coverage
|
|
name: "Test with potgresql backend"
|
|
env:
|
|
- MIGRATION_DIR=migrations/postgres FEATURES=postgres DATABASE_URL=postgres://postgres@localhost/plume_tests
|
|
- RUSTFLAGS='-C link-dead-code' RUST_TEST_THREADS=1
|
|
before_script: psql -c 'create database plume_tests;' -U postgres
|
|
script:
|
|
- |
|
|
cargo test --features "${FEATURES}" --no-default-features --all --exclude plume-front &&
|
|
./script/compute_coverage.sh
|
|
|
|
- stage: test and coverage
|
|
name: "Test with Sqlite backend"
|
|
env:
|
|
- MIGRATION_DIR=migrations/sqlite FEATURES=sqlite DATABASE_URL=plume.sqlite3
|
|
- RUSTFLAGS='-C link-dead-code' RUST_TEST_THREADS=1
|
|
script:
|
|
- |
|
|
cargo test --features "${FEATURES}" --no-default-features --all --exclude plume-front &&
|
|
./script/compute_coverage.sh
|