ligo/.gitlab-ci.yml
2018-07-06 18:18:41 +02:00

554 lines
11 KiB
YAML

variables:
## Please update `scripts/version.sh` accordingly
build_deps_image_version: dea9fc16442f36e71caa459f9675928d6b14a800
build_deps_image_name: registry.gitlab.com/tezos/opam-repository
public_docker_image_name: docker.io/${CI_PROJECT_PATH}
stages:
- build
- test
- opam
- publish
## Template for `docker_in_docker` jobs
.dind_template: &dind_definition
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
before_script:
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- apk add --no-cache curl jq
- . ./scripts/version.sh
tags:
- safe_docker
## Tezos
.build_deps_image_template: &build_deps_image_definition
image: ${build_deps_image_name}:${build_deps_image_version}
except:
- master
- alphanet
- zeronet
- betanet
before_script:
- opam list
- . ./scripts/version.sh
tags:
- gitlab-org
check_deps:
<<: *build_deps_image_definition
stage: build
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
build:
<<: *build_deps_image_definition
stage: build
script:
- make all
- make build-test
artifacts:
paths:
- _build
expire_in: 1 day
## Basic tests (run on merge requests)
.test_template: &test_definition
<<: *build_deps_image_definition
stage: test
dependencies:
- build
test:opam_packaging:
<<: *test_definition
script:
- ./scripts/check_opam_test.sh "$CI_PROJECT_DIR/$CI_CONFIG_PATH"
test:ocp-indent:
<<: *test_definition
script:
- jbuilder build @runtest_indent
test:stdlib:
<<: *test_definition
script:
- jbuilder build @src/lib_stdlib/runtest
test:stdlib_unix:
<<: *test_definition
script:
- jbuilder build @src/lib_stdlib_unix/runtest
test:data_encoding:
<<: *test_definition
script:
- jbuilder build @src/lib_data_encoding/runtest
test:storage:
<<: *test_definition
script:
- jbuilder build @src/lib_storage/runtest
test:crypto:
<<: *test_definition
script:
- jbuilder build @src/lib_crypto/runtest
test:shell:
<<: *test_definition
script:
- jbuilder build @src/lib_shell/runtest
test:p2p:io-scheduler:
<<: *test_definition
script:
- jbuilder build @src/lib_p2p/runtest_p2p_io_scheduler_ipv4
test:p2p:socket:
<<: *test_definition
script:
- jbuilder build @src/lib_p2p/runtest_p2p_socket_ipv4
test:p2p:pool:
<<: *test_definition
script:
- jbuilder build @src/lib_p2p/runtest_p2p_pool_ipv4
test:proto_alpha:
<<: *test_definition
script:
- jbuilder build @src/proto_alpha/lib_protocol/runtest
test:p2p:peerset:
<<: *test_definition
script:
- jbuilder build @src/lib_p2p/runtest_p2p_peerset
test:p2p:ipv6set:
<<: *test_definition
script:
- jbuilder build @src/lib_p2p/runtest_p2p_ipv6set
test:p2p:banned_peers:
<<: *test_definition
script:
- jbuilder build @src/lib_p2p/runtest_p2p_banned_peers
test:client_alpha:vote:
<<: *test_definition
script:
- jbuilder build @src/proto_alpha/lib_delegate/runtest_vote
test:basic.sh:
<<: *test_definition
script:
- jbuilder build @src/bin_client/runtest_basic.sh
test:contracts.sh:
<<: *test_definition
script:
- jbuilder build @src/bin_client/runtest_contracts.sh
test:multinode.sh:
<<: *test_definition
script:
- jbuilder build @src/bin_client/runtest_multinode.sh
test:inject.sh:
<<: *test_definition
script:
- jbuilder build @src/bin_client/runtest_injection.sh
test:proto:sandbox:
<<: *test_definition
script:
- jbuilder build @runtest_sandbox
test:documentation:
<<: *test_definition
script:
- sudo apk add --no-cache py3-sphinx py3-sphinx_rtd_theme
- sudo ln -s /usr/bin/sphinx-build-3 /usr/bin/sphinx-build
- make doc-html
## Basic tests through opam packaged (run on master only)
.opam_template: &opam_definition
image: ${build_deps_image_name}:opam--${build_deps_image_version}
stage: opam
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:tezos-client-base:
<<: *opam_definition
variables:
package: tezos-client-base
opam:27:tezos-protocol-compiler:
<<: *opam_definition
variables:
package: tezos-protocol-compiler
opam:28:tezos-signer-services:
<<: *opam_definition
variables:
package: tezos-signer-services
opam:29:tezos-protocol-alpha:
<<: *opam_definition
variables:
package: tezos-protocol-alpha
opam:30:tezos-protocol-environment:
<<: *opam_definition
variables:
package: tezos-protocol-environment
opam:31:tezos-signer-backends:
<<: *opam_definition
variables:
package: tezos-signer-backends
opam:32:tezos-client-alpha:
<<: *opam_definition
variables:
package: tezos-client-alpha
opam:33:tezos-client-commands:
<<: *opam_definition
variables:
package: tezos-client-commands
opam:34:tezos-protocol-environment-shell:
<<: *opam_definition
variables:
package: tezos-protocol-environment-shell
opam:35:tezos-baking-alpha:
<<: *opam_definition
variables:
package: tezos-baking-alpha
opam:36:tezos-protocol-genesis:
<<: *opam_definition
variables:
package: tezos-protocol-genesis
opam:37:ocplib-resto-json:
<<: *opam_definition
variables:
package: ocplib-resto-json
opam:38:tezos-protocol-updater:
<<: *opam_definition
variables:
package: tezos-protocol-updater
opam:39:tezos-p2p:
<<: *opam_definition
variables:
package: tezos-p2p
opam:40:tezos-baking-alpha-commands:
<<: *opam_definition
variables:
package: tezos-baking-alpha-commands
opam:41:tezos-client-alpha-commands:
<<: *opam_definition
variables:
package: tezos-client-alpha-commands
opam:42:tezos-client-base-unix:
<<: *opam_definition
variables:
package: tezos-client-base-unix
opam:43:tezos-client-genesis:
<<: *opam_definition
variables:
package: tezos-client-genesis
opam:44:ocplib-ezresto:
<<: *opam_definition
variables:
package: ocplib-ezresto
opam:45:ledgerwallet:
<<: *opam_definition
variables:
package: ledgerwallet
opam:46:tezos-embedded-protocol-alpha:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-alpha
opam:47:tezos-embedded-protocol-demo:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-demo
opam:48:tezos-embedded-protocol-genesis:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-genesis
opam:49:tezos-shell:
<<: *opam_definition
variables:
package: tezos-shell
opam:50:tezos-endorser-alpha-commands:
<<: *opam_definition
variables:
package: tezos-endorser-alpha-commands
opam:51:tezos-client:
<<: *opam_definition
variables:
package: tezos-client
opam:52:tezos-endorser-alpha:
<<: *opam_definition
variables:
package: tezos-endorser-alpha
opam:53:tezos-accuser-alpha-commands:
<<: *opam_definition
variables:
package: tezos-accuser-alpha-commands
opam:54:ocplib-ezresto-directory:
<<: *opam_definition
variables:
package: ocplib-ezresto-directory
opam:55:tezos-accuser-alpha:
<<: *opam_definition
variables:
package: tezos-accuser-alpha
opam:56:tezos-baker-alpha:
<<: *opam_definition
variables:
package: tezos-baker-alpha
opam:57:tezos-protocol-demo:
<<: *opam_definition
variables:
package: tezos-protocol-demo
opam:58:tezos-signer:
<<: *opam_definition
variables:
package: tezos-signer
opam:59:ledgerwallet-tezos:
<<: *opam_definition
variables:
package: ledgerwallet-tezos
opam:60:tezos-node:
<<: *opam_definition
variables:
package: tezos-node
opam:59:ocplib-json-typed-browser:
<<: *opam_definition
variables:
package: ocplib-json-typed-browser
opam:60:tezos-baker-alpha-commands:
<<: *opam_definition
variables:
package: tezos-baker-alpha-commands
##END_OPAM##
## Publishing (small) docker images with tezos binaries
publish:docker:minimal:
<<: *dind_definition
stage: publish
only:
- master
- alphanet
- zeronet
- betanet
script:
- ./scripts/create_docker_image.sh
"${public_docker_image}" "${CI_COMMIT_REF_NAME}"
- mkdir ~/.docker || true
- echo "${CI_DOCKER_AUTH}" > ~/.docker/config.json ;
- docker push "${public_docker_image}:${CI_COMMIT_REF_NAME}"
## Publish docs to gitlab...
pages:
image: ${build_deps_image_name}:${build_deps_image_version}
stage: publish
only:
- master@tezos/tezos
artifacts:
paths:
- public
script:
- sudo apk add --no-cache py3-sphinx py3-sphinx_rtd_theme
- sudo ln -s /usr/bin/sphinx-build-3 /usr/bin/sphinx-build
- make doc-html && sudo mv docs/_build "${CI_PROJECT_DIR}"/public
tags:
- gitlab-org