2019-08-28 02:00:12 +03:00
image : rust:1-buster
2018-10-16 19:42:12 +03:00
2018-10-20 13:18:54 +03:00
variables :
2019-08-28 11:40:32 +03:00
SCCACHE_URL : https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-unknown-linux-musl.tar.gz
2019-05-29 19:42:30 +03:00
CARGO_TARGET_DIR : ${CI_PROJECT_DIR}/target
2019-05-22 14:09:56 +03:00
CARGO_HOME : ${CI_PROJECT_DIR}/cargo
2019-05-29 19:42:30 +03:00
SCCACHE_DIR : ${CI_PROJECT_DIR}/sccache
RUSTC_WRAPPER : sccache
2019-08-31 12:38:28 +03:00
OSTREE_VERSION : v2019_3
2018-10-20 13:18:54 +03:00
2018-10-16 19:42:12 +03:00
before_script :
2019-08-28 22:31:57 +03:00
- echo deb https://deb.debian.org/debian unstable main > /etc/apt/sources.list.d/unstable.list
- |
cat > /etc/apt/preferences.d/pin <<EOF
Package : *
Pin : release a=unstable
Pin-Priority : -999
EOF
2018-10-16 19:42:12 +03:00
- apt-get update
2019-08-28 22:31:57 +03:00
- apt-get install -y -t unstable libostree-dev
2019-05-29 19:42:30 +03:00
- wget -O - ${SCCACHE_URL} | tar -C /usr/bin/ -xz --wildcards --strip-components=1 '*/sccache'
2018-10-16 19:42:12 +03:00
2019-05-25 00:23:57 +03:00
cache :
paths :
- cargo/
2019-05-29 19:42:30 +03:00
- sccache/
2019-05-25 00:23:57 +03:00
2018-10-16 19:20:58 +03:00
stages :
- build
2018-10-16 20:27:04 +03:00
- publish
2018-10-16 19:20:58 +03:00
2019-05-31 12:06:21 +03:00
# format and freshness checks
2019-05-25 00:23:57 +03:00
check :
2019-05-31 12:06:21 +03:00
stage : build
2019-05-25 00:23:57 +03:00
script :
2019-05-31 12:06:21 +03:00
- rustup component add rustfmt
2019-05-31 11:39:17 +03:00
- cargo fmt --all -- --check
2019-05-29 01:12:08 +03:00
- rm -rf src/auto/
2019-05-25 00:23:57 +03:00
- make gir
- git diff -R --exit-code
2019-05-31 12:06:21 +03:00
# build
2019-08-29 01:12:27 +03:00
build_all-features :
2018-10-20 13:24:10 +03:00
stage : build
script :
2019-05-31 12:06:21 +03:00
- rustup component add clippy
2019-08-29 01:12:27 +03:00
- cargo clippy --all --features ${OSTREE_VERSION},futures -- -D warnings
- cargo test --verbose --manifest-path sys/Cargo.toml --features ${OSTREE_VERSION}
- cargo test --verbose --features ${OSTREE_VERSION},futures
2019-05-22 11:51:54 +03:00
2019-08-29 01:12:27 +03:00
build_default-features :
2019-08-28 22:31:57 +03:00
stage : build
script :
- cargo test --verbose
2018-10-16 19:20:58 +03:00
2018-10-16 21:28:37 +03:00
# docs
2018-10-18 02:37:50 +03:00
docs :
2018-10-20 13:24:10 +03:00
stage : build
2019-08-28 02:05:26 +03:00
image : rustlang/rust:nightly-buster
2019-05-22 22:40:30 +03:00
variables :
RUSTDOC_OPTS : >-
-Z unstable-options
--extern-html-root-url glib_sys=https://gtk-rs.org/docs
--extern-html-root-url gobject_sys=https://gtk-rs.org/docs
--extern-html-root-url gio_sys=https://gtk-rs.org/docs
--extern-html-root-url glib=https://gtk-rs.org/docs
--extern-html-root-url gio=https://gtk-rs.org/docs
2018-10-16 21:28:37 +03:00
script :
2018-10-18 22:58:56 +03:00
- make merge-lgpl-docs
2019-05-22 22:40:30 +03:00
- cargo rustdoc --verbose --package ostree-sys --features dox -- ${RUSTDOC_OPTS}
2019-06-29 00:40:58 +03:00
- cargo rustdoc --verbose --package ostree --features dox,futures -- ${RUSTDOC_OPTS}
2019-05-31 12:58:07 +03:00
artifacts :
paths :
- target/doc
pages :
stage : publish
image : alpine
before_script : [ ]
script :
2018-10-16 21:28:37 +03:00
- cp -r target/doc public
2019-05-31 12:58:07 +03:00
cache : {}
2018-10-16 21:28:37 +03:00
artifacts :
paths :
- public
2018-10-16 22:05:34 +03:00
only :
- master
2019-05-31 12:06:21 +03:00
# publish
publish_ostree-sys :
stage : publish
script :
- cargo publish --verbose --manifest-path sys/Cargo.toml --token $CRATES_IO_TOKEN
cache : {}
when : manual
publish_ostree :
stage : publish
script :
- cargo publish --verbose --token $CRATES_IO_TOKEN
cache : {}
when : manual