sequoia-sq/.gitlab-ci.yml

180 lines
5.4 KiB
YAML
Raw Normal View History

2023-02-23 14:38:21 +03:00
stages:
- pre-check
- build
- test
- deploy
2023-02-23 14:38:21 +03:00
2024-02-29 01:31:15 +03:00
include:
- component: gitlab.com/sequoia-pgp/common-ci/precheck@main
inputs:
codespell_ignore_words: "crate,ede,iff,mut,nd,te,uint,KeyServer,keyserver,Keyserver,keyservers,Keyservers,keypair,keypairs,KeyPair,fpr,dedup,deriver,certi,certp,certo"
codespell_skip_files: "*.bin,*.gpg,*.pgp,./.git,*/target,Cargo.lock,./tests/data,openpgp-policy.toml"
- component: gitlab.com/sequoia-pgp/common-ci/authenticate-commits@main
- component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
inputs:
job_name: trixie
image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild
cargo_args: '--features=subplot'
- component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
inputs:
job_name: trixie-crypto-openssl
image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild
cargo_args: '--no-default-features --features crypto-openssl'
- component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
inputs:
job_name: rust-stable
image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/rust-stable-prebuild
cargo_args: '--features=subplot'
trixie-build:
after_script:
2023-02-23 14:38:21 +03:00
- if ! git diff --quiet Cargo.lock ; then echo "Cargo.lock changed. Please add the change to the corresponding commit." ; git diff ; false ; fi
- if ! git diff --quiet ; then echo "The build changed the source. Please investigate." ; git diff ; fi
sq-features:
tags:
- linux
stage: build
interruptible: true
2023-11-24 19:03:54 +03:00
image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie:latest
2023-02-23 14:38:21 +03:00
only:
refs:
- tags
- web
- schedules
parallel:
matrix:
- FEATURES:
- ""
script:
- cargo test --no-default-features --features crypto-nettle$FEATURES
2023-02-23 14:38:21 +03:00
all_commits:
# Test each commit up to main, to facilitate bisecting.
stage: test
interruptible: true
2024-02-29 01:31:15 +03:00
image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild:latest
needs: ["rust-stable-build"]
2023-02-23 14:38:21 +03:00
script:
- .ci/all_commits.sh
2024-02-29 01:31:15 +03:00
rules:
- !reference [.default_rules, rules]
2023-02-23 14:38:21 +03:00
variables:
GIT_STRATEGY: clone
deny:
tags:
- linux
stage: test
interruptible: true
image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/rust-stable:latest
before_script:
2024-02-29 01:31:15 +03:00
- !reference [.before_script, start]
- cargo install --locked cargo-deny
2024-02-29 01:31:15 +03:00
- !reference [.before_script, end]
script:
- cargo deny check
2023-02-23 14:38:21 +03:00
clippy:
tags:
- linux
stage: build
interruptible: true
2024-02-29 01:31:15 +03:00
image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/rust-stable-prebuild:latest
2023-02-23 14:38:21 +03:00
before_script:
2024-02-29 01:31:15 +03:00
- !reference [.before_script, start]
- rustup default 1.70.0 # Pin clippy.
2023-02-23 14:38:21 +03:00
- rustup component add clippy
- cargo clippy --version
2024-02-29 01:31:15 +03:00
- !reference [.before_script, end]
2023-02-23 14:38:21 +03:00
script:
- cargo clippy
2024-02-29 01:31:15 +03:00
rules:
- !reference [.default_rules, rules]
2023-02-23 14:38:21 +03:00
windows-gnu-cng:
2023-02-23 14:38:21 +03:00
tags:
- win
- win2019
stage: build
interruptible: true
image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/windows-gnu
2023-02-23 14:38:21 +03:00
only:
variables:
# Forks of this project most likely use gitlab's shared windows runners, which
# do not use the docker executor, so disable the windows jobs for forks.
- $CI_PROJECT_NAMESPACE == "sequoia-pgp"
before_script:
# We don't call *before_script_start or *before_script_end as we
# don't have bash, clang, etc.
2023-11-29 15:35:55 +03:00
- rustup default "1.70.0"
2023-02-23 14:38:21 +03:00
- rustc --version --verbose
- cargo --version
script:
# https://github.com/rust-lang/cargo/issues/5015
- pacman --noconfirm --needed -S mingw-w64-x86_64-openssl
- cargo test --tests --no-default-features --features crypto-cng,subplot
2023-02-23 14:38:21 +03:00
after_script: [] # scriptlet doesn't work on Powershell
variables:
CFLAGS: "" # Silence some C warnings when compiling under Windows
2023-02-23 14:38:21 +03:00
docker-build-push:
# Official docker image.
image: docker:stable
stage: build
services:
- docker:dind
tags:
- docker
- self-hosted
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- >
docker build
--no-cache
--target sq
--tag "$IMAGE":latest
.
# smoke test
- docker run "$IMAGE":latest --help
- docker push "$IMAGE":latest
after_script: []
only:
refs:
- /docker/i # refs containing 'docker' keyword
- tags
- web
- schedules
variables:
CI_REGISTRY: "registry.gitlab.com"
IMAGE: "$CI_REGISTRY/sequoia-pgp/sequoia-sq"
DOCKER_HOST: tcp://docker:2376
pages:
stage: deploy
image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-pandoc:latest
script:
- ASSET_OUT_DIR=/tmp/assets cargo doc --no-deps -p sequoia-sq
- mkdir public
- mv -v target/doc public/impl
- for M in /tmp/assets/man-pages/*; do pandoc -s $M -L src/man-pandoc.lua -H src/man-pandoc.inc.html -o $M.html ; done
- mkdir public/man
- mv -v /tmp/assets/man-pages/*.html public/man
- mkdir public/subplot
- pandoc -s -o public/subplot/sq-subplot.html sq-subplot.md
- pandoc -s -o public/subplot/sq-subplot.pdf sq-subplot.md
- echo "/sequoia-sq/ /sequoia-sq/man/sq.1.html 302" > public/_redirects
2024-01-08 20:46:06 +03:00
- echo "/sequoia-sq/impl /sequoia-sq/impl/sq/index.html 302" >> public/_redirects
- echo "/sequoia-sq/man /sequoia-sq/man/sq.1.html 302" >> public/_redirects
- echo "/sequoia-sq/subplot /sequoia-sq/subplot/sq-subplot.html 302" >> public/_redirects
artifacts:
paths:
- public
only:
- main