55 lines
1.5 KiB
YAML
55 lines
1.5 KiB
YAML
stages:
|
|
- test
|
|
- lint
|
|
|
|
variables:
|
|
# RUSTFLAGS: "-C link-dead-code"
|
|
RUST_BACKTRACE: "FULL"
|
|
|
|
.cargo_test_template: &cargo_test
|
|
stage: test
|
|
|
|
before_script:
|
|
- apt-get update -yqq
|
|
- apt-get install -yqq --no-install-recommends build-essential libgtk-3-dev meson
|
|
script:
|
|
- rustc -Vv && cargo -Vv
|
|
# Force regeneration of gresources regardless of artifacts chage
|
|
- cd hammond-gtk/resources/ && glib-compile-resources --generate resources.xml && cd ../../
|
|
|
|
- ./configure --prefix=/usr/local
|
|
- make
|
|
- cargo test --release -- --test-threads=1
|
|
- cargo test --release -- --test-threads=1 --ignored
|
|
|
|
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
|