ligo/.gitlab-ci.yml
2018-12-10 13:25:01 +01:00

612 lines
13 KiB
YAML

variables:
## Please update `scripts/version.sh` accordingly
build_deps_image_version: 4200cbebcae75562d79898a8e11e9f4dc237cc08
build_deps_image_name: registry.gitlab.com/tezos/opam-repository
public_docker_image_name: docker.io/${CI_PROJECT_PATH}
stages:
- doc
- build
- test
- packaging
- publish
############################################################
## Stage: build (only MR) ##
############################################################
.build_template: &build_definition
image: ${build_deps_image_name}:${build_deps_image_version}
stage: build
except:
- master
- alphanet
- zeronet
- mainnet
- alphanet-staging
- zeronet-staging
- mainnet-staging
before_script:
- opam list
- . ./scripts/version.sh
tags:
- gitlab-org
check_opam_deps:
<<: *build_definition
script:
- if [ "${build_deps_image_version}" != "${opam_repository_tag}" ] ; then
echo "Inconsistent dependencies hash between 'scripts/version.sh' and '.gitlab-ci.yml'." ;
exit 1 ;
fi
- ./scripts/opam-check.sh
- ./scripts/check_opam_test.sh
check_indentation:
<<: *build_definition
script:
- dune build @runtest_indent
build:
<<: *build_definition
script:
- make all
artifacts:
paths:
- _build
expire_in: 1 day
############################################################
## Stage: test (only MR) ##
############################################################
.test_template: &test_definition
<<: *build_definition
stage: test
dependencies:
- build
test:stdlib:
<<: *test_definition
script:
- dune build @src/lib_stdlib/runtest
test:stdlib_unix:
<<: *test_definition
script:
- dune build @src/lib_stdlib_unix/runtest
test:data_encoding:
<<: *test_definition
script:
- dune build @src/lib_data_encoding/runtest
test:storage:
<<: *test_definition
script:
- dune build @src/lib_storage/runtest
test:crypto:
<<: *test_definition
script:
- dune build @src/lib_crypto/runtest
test:shell:
<<: *test_definition
script:
- dune build @src/lib_shell/runtest
test:p2p:io-scheduler:
<<: *test_definition
script:
- dune build @src/lib_p2p/runtest_p2p_io_scheduler_ipv4
test:p2p:socket:
<<: *test_definition
script:
- dune build @src/lib_p2p/runtest_p2p_socket_ipv4
test:p2p:pool:
<<: *test_definition
script:
- dune build @src/lib_p2p/runtest_p2p_pool_ipv4
test:proto_alpha:
<<: *test_definition
script:
- dune build @src/proto_alpha/lib_protocol/runtest
test:p2p:peerset:
<<: *test_definition
script:
- dune build @src/lib_p2p/runtest_p2p_peerset
test:p2p:ipv6set:
<<: *test_definition
script:
- dune build @src/lib_p2p/runtest_p2p_ipv6set
test:p2p:banned_peers:
<<: *test_definition
script:
- dune build @src/lib_p2p/runtest_p2p_banned_peers
test:client_alpha:vote:
<<: *test_definition
script:
- dune build @src/proto_alpha/lib_delegate/runtest_vote
test:basic.sh:
<<: *test_definition
script:
- dune build @src/bin_client/runtest_basic.sh
test:contracts.sh:
<<: *test_definition
script:
- dune build @src/bin_client/runtest_contracts.sh
test:contracts_opcode.sh:
<<: *test_definition
script:
- dune build @src/bin_client/runtest_contracts_opcode.sh
test:contracts_macros.sh:
<<: *test_definition
script:
- dune build @src/bin_client/runtest_contracts_macros.sh
test:contracts_mini_scenarios.sh:
<<: *test_definition
script:
- dune build @src/bin_client/runtest_contracts_mini_scenarios.sh
test:multinode.sh:
<<: *test_definition
script:
- dune build @src/bin_client/runtest_multinode.sh
test:inject.sh:
<<: *test_definition
script:
- dune build @src/bin_client/runtest_injection.sh
test:proto:sandbox:
<<: *test_definition
script:
- dune build @runtest_sandbox
test:documentation:
<<: *test_definition
script:
- sudo apk add --no-cache py3-sphinx py3-sphinx_rtd_theme
- sudo pip3 uninstall 'idna' --yes ## Fix up dependencies in alpine:3.8
- sudo pip3 install 'idna<2.7'
- sudo ln -s /usr/bin/sphinx-build-3 /usr/bin/sphinx-build
- make doc-html
test:linkcheck:
<<: *test_definition
script:
- sudo apk add --no-cache py3-sphinx py3-sphinx_rtd_theme
- sudo pip3 uninstall 'idna' --yes ## Fix up dependencies in alpine:3.8
- sudo pip3 install 'idna<2.7'
- sudo ln -s /usr/bin/sphinx-build-3 /usr/bin/sphinx-build
- make doc-html-and-linkcheck
allow_failure: true
test:validation:
<<: *test_definition
script:
- dune build @src/lib_validation/runtest
############################################################
## Stage: building opam packages (only master and *opam*) ##
############################################################
.opam_template: &opam_definition
image: ${build_deps_image_name}:opam--${build_deps_image_version}
stage: packaging
dependencies: []
only:
- master
- /^.*opam.*$/
script:
- ./scripts/opam-pin.sh
- opam depext --yes ${package}
- opam install --yes ${package}
- opam reinstall --yes --with-test ${package}
tags:
- gitlab-org
##BEGIN_OPAM##
opam:00:ocplib-json-typed:
<<: *opam_definition
variables:
package: ocplib-json-typed
opam:01:ocplib-json-typed-bson:
<<: *opam_definition
variables:
package: ocplib-json-typed-bson
opam:02:tezos-stdlib:
<<: *opam_definition
variables:
package: tezos-stdlib
opam:03:tezos-data-encoding:
<<: *opam_definition
variables:
package: tezos-data-encoding
opam:04:ocplib-resto:
<<: *opam_definition
variables:
package: ocplib-resto
opam:05:tezos-error-monad:
<<: *opam_definition
variables:
package: tezos-error-monad
opam:06:ocplib-resto-directory:
<<: *opam_definition
variables:
package: ocplib-resto-directory
opam:07:blake2:
<<: *opam_definition
variables:
package: blake2
opam:08:hacl:
<<: *opam_definition
variables:
package: hacl
opam:09:secp256k1:
<<: *opam_definition
variables:
package: secp256k1
opam:10:tezos-clic:
<<: *opam_definition
variables:
package: tezos-clic
opam:11:tezos-rpc:
<<: *opam_definition
variables:
package: tezos-rpc
opam:12:uecc:
<<: *opam_definition
variables:
package: uecc
opam:13:tezos-crypto:
<<: *opam_definition
variables:
package: tezos-crypto
opam:14:tezos-micheline:
<<: *opam_definition
variables:
package: tezos-micheline
opam:15:lmdb:
<<: *opam_definition
variables:
package: lmdb
opam:16:pbkdf:
<<: *opam_definition
variables:
package: pbkdf
opam:17:ocplib-resto-cohttp:
<<: *opam_definition
variables:
package: ocplib-resto-cohttp
opam:18:tezos-base:
<<: *opam_definition
variables:
package: tezos-base
opam:19:irmin-lmdb:
<<: *opam_definition
variables:
package: irmin-lmdb
opam:20:bip39:
<<: *opam_definition
variables:
package: bip39
opam:21:tezos-rpc-http:
<<: *opam_definition
variables:
package: tezos-rpc-http
opam:22:tezos-shell-services:
<<: *opam_definition
variables:
package: tezos-shell-services
opam:23:tezos-stdlib-unix:
<<: *opam_definition
variables:
package: tezos-stdlib-unix
opam:24:tezos-storage:
<<: *opam_definition
variables:
package: tezos-storage
opam:25:tezos-protocol-environment-sigs:
<<: *opam_definition
variables:
package: tezos-protocol-environment-sigs
opam:26:ledgerwallet:
<<: *opam_definition
variables:
package: ledgerwallet
opam:27:tezos-client-base:
<<: *opam_definition
variables:
package: tezos-client-base
opam:28:tezos-protocol-compiler:
<<: *opam_definition
variables:
package: tezos-protocol-compiler
opam:29:ledgerwallet-tezos:
<<: *opam_definition
variables:
package: ledgerwallet-tezos
opam:30:tezos-signer-services:
<<: *opam_definition
variables:
package: tezos-signer-services
opam:31:tezos-protocol-alpha:
<<: *opam_definition
variables:
package: tezos-protocol-alpha
opam:32:tezos-protocol-environment:
<<: *opam_definition
variables:
package: tezos-protocol-environment
opam:33:tezos-signer-backends:
<<: *opam_definition
variables:
package: tezos-signer-backends
opam:34:tezos-client-alpha:
<<: *opam_definition
variables:
package: tezos-client-alpha
opam:35:tezos-client-commands:
<<: *opam_definition
variables:
package: tezos-client-commands
opam:36:tezos-protocol-environment-shell:
<<: *opam_definition
variables:
package: tezos-protocol-environment-shell
opam:37:tezos-baking-alpha:
<<: *opam_definition
variables:
package: tezos-baking-alpha
opam:38:tezos-protocol-genesis:
<<: *opam_definition
variables:
package: tezos-protocol-genesis
opam:39:ocplib-resto-json:
<<: *opam_definition
variables:
package: ocplib-resto-json
opam:40:tezos-protocol-updater:
<<: *opam_definition
variables:
package: tezos-protocol-updater
opam:41:tezos-p2p:
<<: *opam_definition
variables:
package: tezos-p2p
opam:42:tezos-baking-alpha-commands:
<<: *opam_definition
variables:
package: tezos-baking-alpha-commands
opam:43:tezos-client-alpha-commands:
<<: *opam_definition
variables:
package: tezos-client-alpha-commands
opam:44:tezos-client-base-unix:
<<: *opam_definition
variables:
package: tezos-client-base-unix
opam:45:tezos-client-genesis:
<<: *opam_definition
variables:
package: tezos-client-genesis
opam:46:ocplib-ezresto:
<<: *opam_definition
variables:
package: ocplib-ezresto
opam:47:tezos-embedded-protocol-alpha:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-alpha
opam:48:tezos-shell:
<<: *opam_definition
variables:
package: tezos-shell
opam:49:tezos-embedded-protocol-demo:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-demo
opam:50:tezos-embedded-protocol-genesis:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-genesis
opam:51:tezos-endorser-alpha-commands:
<<: *opam_definition
variables:
package: tezos-endorser-alpha-commands
opam:52:tezos-client:
<<: *opam_definition
variables:
package: tezos-client
opam:53:ocplib-ezresto-directory:
<<: *opam_definition
variables:
package: ocplib-ezresto-directory
opam:54:tezos-validation:
<<: *opam_definition
variables:
package: tezos-validation
opam:55:tezos-accuser-alpha:
<<: *opam_definition
variables:
package: tezos-accuser-alpha
opam:56:tezos-endorser-alpha:
<<: *opam_definition
variables:
package: tezos-endorser-alpha
opam:57:tezos-accuser-alpha-commands:
<<: *opam_definition
variables:
package: tezos-accuser-alpha-commands
opam:58:tezos-baker-alpha:
<<: *opam_definition
variables:
package: tezos-baker-alpha
opam:59:tezos-protocol-demo:
<<: *opam_definition
variables:
package: tezos-protocol-demo
opam:60:tezos-signer:
<<: *opam_definition
variables:
package: tezos-signer
opam:61:tezos-node:
<<: *opam_definition
variables:
package: tezos-node
opam:62:ocplib-json-typed-browser:
<<: *opam_definition
variables:
package: ocplib-json-typed-browser
opam:63:tezos-baker-alpha-commands:
<<: *opam_definition
variables:
package: tezos-baker-alpha-commands
##END_OPAM##
############################################################
## Stage: publish ##
############################################################
publish:docker:
image: docker:latest
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
stage: publish
only:
- master
- alphanet
- zeronet
- mainnet
- alphanet-staging
- zeronet-staging
- mainnet-staging
before_script:
- mkdir ~/.docker || true
- echo "${CI_DOCKER_AUTH}" > ~/.docker/config.json
script:
- ./scripts/create_docker_image.sh
"${public_docker_image_name}" "${CI_COMMIT_REF_NAME}"
- docker push "${public_docker_image_name}:${CI_COMMIT_REF_NAME}"
tags:
- safe_docker
publish:doc:
image: ${build_deps_image_name}:${build_deps_image_version}
stage: doc
only:
- master
- alphanet
- zeronet
- mainnet
before_script:
- sudo apk add --no-cache py3-sphinx py3-sphinx_rtd_theme openssh-client rsync
- sudo pip3 uninstall 'idna' --yes ## Fix up dependencies in alpine:3.8
- sudo pip3 install 'idna<2.7'
- sudo ln -s /usr/bin/sphinx-build-3 /usr/bin/sphinx-build
- echo "${CI_PK_GITLAB_DOC}" > ~/.ssh/id_ed25519
- echo "${CI_KH}" > ~/.ssh/known_hosts
- chmod 400 ~/.ssh/id_ed25519
script:
- make doc-html
- git clone git@gitlab.com:${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAMESPACE}.gitlab.io gitlab.io
- rsync --recursive --links --perms --delete --verbose
--exclude=.doctrees
docs/_build/ gitlab.io/public/"${CI_COMMIT_REF_NAME}"
- cd gitlab.io
- if [ -z "$(git status -s)" ] ; then
echo "Nothing to commit!" ;
else
git add public/"${CI_COMMIT_REF_NAME}" ;
git commit -m "Import doc for ${CI_COMMIT_REF_NAME} (${CI_COMMIT_SHA})" ;
git push origin master ;
fi
tags:
- gitlab-org