ostree/rust-bindings/.gitlab-ci.yml
2022-05-06 12:53:57 -04:00

91 lines
2.0 KiB
YAML

include: /.ci/gitlab-ci-base.yml
stages:
- test
- publish
# generate feature test jobs
generate-test-jobs:
stage: .pre
image: rust
script:
- mkdir -p target
- apt-get update && apt-get install -y jq
- .ci/generate-test-jobs.sh > target/test-jobs.yaml
artifacts:
paths:
- target/test-jobs.yaml
# test
check:
stage: test
extends: .rust-ostree-devel
script:
- rustup component add clippy rustfmt
# fmt
- cargo fmt --package ostree -- --check
# check generated code
- rm -rf src/auto/
- make gir
- git checkout -- sys/src/auto/versions.txt src/auto/versions.txt
- git diff -R --exit-code
# clippy
- cargo clippy --workspace --all-features
test_default-features:
extends: .fedora-ostree-devel
script:
- cargo test --verbose --workspace
test_all_features:
stage: test
trigger:
include:
- artifact: target/test-jobs.yaml
job: generate-test-jobs
strategy: depend
build_aarch64:
stage: test
extends: .rust-ostree-devel
script:
- rustup target add aarch64-unknown-linux-gnu
- PKG_CONFIG_ALLOW_CROSS=1 cargo build --verbose --workspace --all-features --target aarch64-unknown-linux-gnu
# docs
pages:
stage: publish
extends: .rust-ostree-devel
image: rustlang/rust:nightly
variables:
RUSTDOCFLAGS: >-
-Z unstable-options
--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 doc --verbose --workspace --features dox --no-deps
- cp -r target/doc public
artifacts:
paths:
- public
only:
- main
# publish
publish_ostree-sys:
stage: publish
extends: .rust-ostree-devel
script:
- cargo publish --verbose --manifest-path sys/Cargo.toml --token $CRATES_IO_TOKEN
only:
- /^ostree-sys\/.+$/
publish_ostree:
stage: publish
extends: .rust-ostree-devel
script:
- cargo publish --verbose --token $CRATES_IO_TOKEN
only:
- /^ostree\/.+$/