From 0dea1ccef090abee429576265079b73d578c55c3 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sun, 12 Nov 2017 13:32:08 +0200 Subject: [PATCH 1/2] Added a basic gitlab-ci config. --- .gitlab-ci.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..a89050cc --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,49 @@ +stages: + - test + - 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 libgmp-dev +# - apt-get install -yqq --no-install-recommends meson + +test:stable: + # Stable img + # https://hub.docker.com/_/rust/ + image: "rust" + script: + - rustc --version && cargo --version + - cargo build --all + - cargo test --all --verbose + +test:nightly: + # Nightly + # https://hub.docker.com/r/rustlang/rust/ + image: "rustlang/rust:nightly" + script: + - rustc --version && cargo --version + - cargo build --all + - cargo test --all --verbose + # - cargo bench + +# Configure and run rustfmt on nightly +# Exits and builds fails on bad format +lint:rustfmt: + image: "rustlang/rust:nightly" + script: + - rustc --version && cargo --version + - cargo install rustfmt + - cargo fmt --all -- --write-mode=diff + allow_failure: true + +# Configure and run clippy on nightly +# Only fails on errors atm. +lint:clippy: + image: "rustlang/rust:nightly" + script: + - rustc --version && cargo --version + - cargo install clippy + - cargo clippy --all + allow_failure: true From 23b9412bf1fb8429ba430b1142533ec65b8e6082 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sun, 12 Nov 2017 14:35:10 +0200 Subject: [PATCH 2/2] Use of the nightly version of rustfmt. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a89050cc..d49f6b2c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,7 +34,7 @@ lint:rustfmt: image: "rustlang/rust:nightly" script: - rustc --version && cargo --version - - cargo install rustfmt + - cargo install rustfmt-nightly - cargo fmt --all -- --write-mode=diff allow_failure: true