ostree/rust-bindings/rust/.gitlab-ci.yml

200 lines
5.0 KiB
YAML

image: fedora:rawhide
variables:
SCCACHE_URL: https://github.com/mozilla/sccache/releases/download/0.2.12/sccache-0.2.12-x86_64-unknown-linux-musl.tar.gz
CARGO_TARGET_DIR: ${CI_PROJECT_DIR}/target
CARGO_HOME: ${CI_PROJECT_DIR}/cargo
SCCACHE_DIR: ${CI_PROJECT_DIR}/sccache
RUSTC_WRAPPER: sccache
before_script:
- dnf install -y cargo rust rustfmt clippy ostree-devel
- curl -L "${SCCACHE_URL}" | tar -C /usr/bin/ -xz --wildcards --strip-components=1 '*/sccache'
cache:
paths:
- cargo/
- sccache/
stages:
- check
- build
- publish
# format and freshness checks
fmt:
stage: check
script:
- cargo fmt --package ostree -- --check
gir:
stage: check
script:
- dnf install -y make
- rm -rf src/auto/
- make gir
- git checkout -- sys/src/auto/versions.txt src/auto/versions.txt
- git diff -R --exit-code
clippy:
stage: check
script:
- cargo clippy --all --all-features
# build
build_default-features:
stage: build
script:
- cargo test --verbose --all
# all feature levels
build_v2014_9:
stage: build
script: cargo test --verbose --all --features v2014_9
build_v2015_7:
stage: build
script: cargo test --verbose --all --features v2015_7
build_v2016_14:
stage: build
script: cargo test --verbose --all --features v2016_14
build_v2016_4:
stage: build
script: cargo test --verbose --all --features v2016_4
build_v2016_5:
stage: build
script: cargo test --verbose --all --features v2016_5
build_v2016_6:
stage: build
script: cargo test --verbose --all --features v2016_6
build_v2016_7:
stage: build
script: cargo test --verbose --all --features v2016_7
build_v2016_8:
stage: build
script: cargo test --verbose --all --features v2016_8
build_v2017_1:
stage: build
script: cargo test --verbose --all --features v2017_1
build_v2017_10:
stage: build
script: cargo test --verbose --all --features v2017_10
build_v2017_11:
stage: build
script: cargo test --verbose --all --features v2017_11
build_v2017_12:
stage: build
script: cargo test --verbose --all --features v2017_12
build_v2017_13:
stage: build
script: cargo test --verbose --all --features v2017_13
build_v2017_15:
stage: build
script: cargo test --verbose --all --features v2017_15
build_v2017_2:
stage: build
script: cargo test --verbose --all --features v2017_2
build_v2017_3:
stage: build
script: cargo test --verbose --all --features v2017_3
build_v2017_4:
stage: build
script: cargo test --verbose --all --features v2017_4
build_v2017_6:
stage: build
script: cargo test --verbose --all --features v2017_6
build_v2017_7:
stage: build
script: cargo test --verbose --all --features v2017_7
build_v2017_8:
stage: build
script: cargo test --verbose --all --features v2017_8
build_v2017_9:
stage: build
script: cargo test --verbose --all --features v2017_9
build_v2018_2:
stage: build
script: cargo test --verbose --all --features v2018_2
build_v2018_3:
stage: build
script: cargo test --verbose --all --features v2018_3
build_v2018_5:
stage: build
script: cargo test --verbose --all --features v2018_5
build_v2018_6:
stage: build
script: cargo test --verbose --all --features v2018_6
build_v2018_7:
stage: build
script: cargo test --verbose --all --features v2018_7
build_v2018_9:
stage: build
script: cargo test --verbose --all --features v2018_9
build_v2019_2:
stage: build
script: cargo test --verbose --all --features v2019_2
build_v2019_3:
stage: build
script: cargo test --verbose --all --features v2019_3
build_v2019_4:
stage: build
script: cargo test --verbose --all --features v2019_4
build_v2019_6:
stage: build
script: cargo test --verbose --all --features v2019_6
build_v2020_1:
stage: build
script: cargo test --verbose --all --features v2020_1
# all feature levels
# docs
docs:
stage: build
image: rustlang/rust:nightly
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
before_script:
- curl -L "${SCCACHE_URL}" | tar -C /usr/bin/ -xz --wildcards --strip-components=1 '*/sccache'
script:
- make merge-lgpl-docs
- cargo rustdoc --verbose --package ostree-sys --features dox -- ${RUSTDOC_OPTS}
- cargo rustdoc --verbose --package ostree --features dox -- ${RUSTDOC_OPTS}
artifacts:
paths:
- target/doc
pages:
stage: publish
image: alpine
before_script: []
script:
- cp -r target/doc public
cache: {}
artifacts:
paths:
- public
only:
- master
# publish
publish_ostree-sys:
stage: publish
script:
- cargo publish --verbose --manifest-path sys/Cargo.toml --token $CRATES_IO_TOKEN
cache: {}
only:
- /^ostree-sys\/.+$/
publish_ostree:
stage: publish
script:
- cargo publish --verbose --token $CRATES_IO_TOKEN
cache: {}
only:
- /^ostree\/.+$/