podcasts/.gitlab-ci.yml
2018-02-26 17:49:20 +02:00

59 lines
1.7 KiB
YAML

stages:
# meson uses cargo to do the build
# so it's ok to have the tests first.
- test
# - build
- lint
before_script:
- apt-get update -yqq
- apt-get install -yqq --no-install-recommends build-essential
- apt-get install -yqq --no-install-recommends libgtk-3-dev
# - apt-get install -yqq --no-install-recommends meson
.cargo_test_template: &cargo_test
stage: test
script:
- rustc --version && cargo --version
# Force regeneration of gresources regardless of artifacts chage
- cd hammond-gtk/resources/ && glib-compile-resources --generate resources.xml && cd ../../
- cargo build
- cargo test --verbose -- --test-threads=1
- cargo test --verbose -- --test-threads=1 --ignored
variables:
# RUSTFLAGS: "-C link-dead-code"
RUST_BACKTRACE: "FULL"
CARGO_HOME: $CI_PROJECT_DIR/cargo
stable:test:
# https://hub.docker.com/_/rust/
image: "rust"
<<: *cargo_test
# nightly:test:
# # https://hub.docker.com/r/rustlang/rust/
# image: "rustlang/rust:nightly"
# <<: *cargo_test
# Configure and run rustfmt on nightly
# Exits and builds fails if on bad format
rustfmt:
image: "registry.gitlab.com/alatiera/rustfmt-oci-image/rustfmt:nightly"
stage: lint
script:
- rustc --version && cargo --version
- cargo fmt --all -- --write-mode=diff
# Configure and run clippy on nightly
# Only fails on errors atm.
# clippy:
# image: "rustlang/rust:nightly"
# stage: lint
# script:
# - rustc --version && cargo --version
# - cargo install clippy --force
# # Force regeneration of gresources regardless of artifacts chage
# - cd hammond-gtk/resources/ && glib-compile-resources --generate resources.xml && cd ../../
# - cargo clippy --all