mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-11 09:18:20 +03:00
103 lines
2.4 KiB
YAML
103 lines
2.4 KiB
YAML
image: rust:1-buster
|
|
|
|
variables:
|
|
SCCACHE_URL: https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-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
|
|
OSTREE_VERSION: v2019_3
|
|
|
|
before_script:
|
|
- 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
|
|
- apt-get update
|
|
- apt-get install -y -t unstable libostree-dev
|
|
- wget -O - ${SCCACHE_URL} | tar -C /usr/bin/ -xz --wildcards --strip-components=1 '*/sccache'
|
|
|
|
cache:
|
|
paths:
|
|
- cargo/
|
|
- sccache/
|
|
|
|
stages:
|
|
- build
|
|
- publish
|
|
|
|
# format and freshness checks
|
|
check:
|
|
stage: build
|
|
script:
|
|
- rustup component add rustfmt
|
|
- cargo fmt --all -- --check
|
|
- rm -rf src/auto/
|
|
- make gir
|
|
- git diff -R --exit-code
|
|
|
|
# build
|
|
build_all-features:
|
|
stage: build
|
|
script:
|
|
- rustup component add clippy
|
|
- 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
|
|
|
|
build_default-features:
|
|
stage: build
|
|
script:
|
|
- cargo test --verbose
|
|
|
|
# docs
|
|
docs:
|
|
stage: build
|
|
image: rustlang/rust:nightly-buster
|
|
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
|
|
script:
|
|
- make merge-lgpl-docs
|
|
- cargo rustdoc --verbose --package ostree-sys --features dox -- ${RUSTDOC_OPTS}
|
|
- cargo rustdoc --verbose --package ostree --features dox,futures -- ${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: {}
|
|
when: manual
|
|
|
|
publish_ostree:
|
|
stage: publish
|
|
script:
|
|
- cargo publish --verbose --token $CRATES_IO_TOKEN
|
|
cache: {}
|
|
when: manual
|