ligo/.gitlab-ci.yml

680 lines
14 KiB
YAML
Raw Normal View History

2016-09-08 21:13:10 +04:00
variables:
opam_image: ${CI_REGISTRY_IMAGE}/opam
build_deps_image: ${CI_REGISTRY_IMAGE}/build_deps
public_docker_image: docker.io/${CI_PROJECT_PATH}
2016-09-08 21:13:10 +04:00
stages:
- precheck
2017-08-10 12:05:44 +04:00
- prepare
- build_deps
2016-09-08 21:13:10 +04:00
- build
- test
- opam
2016-09-08 21:13:10 +04:00
- publish
2017-03-09 17:43:59 +04:00
- deploy
2016-09-08 21:13:10 +04:00
- cleanup
## Check zeronet/alphanet
precheck:constant:
image: ${opam_image}
stage: precheck
only:
- zeronet
- alphanet
script:
- ./scripts/check_patch.sh "${CI_COMMIT_REF_NAME}"
2017-08-04 20:32:52 +04:00
## Template for `docker_in_docker` jobs
.dind_template: &dind_definition
2017-03-05 05:15:14 +04:00
image: docker:latest
2017-08-04 20:32:52 +04:00
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
2016-09-08 21:13:10 +04:00
tags:
- safe_docker
2017-08-10 12:05:44 +04:00
2017-12-07 02:03:27 +04:00
prepare:opam:
2017-08-10 12:05:44 +04:00
<<: *dind_definition
stage: prepare
only:
variables:
- $UPDATE_OPAM
2017-08-10 12:05:44 +04:00
script:
- ./scripts/ci/create_docker_image.opam.sh "${opam_image}"
- docker push "${opam_image}:alpine-${alpine_version}_ocaml-${ocaml_version}"
- docker tag "${opam_image}:alpine-${alpine_version}_ocaml-${ocaml_version}"
"${opam_image}:latest"
- docker push "${opam_image}:latest"
2017-08-10 12:05:44 +04:00
## Tezos build dependencies
2016-09-08 21:13:10 +04:00
build_deps:
2017-08-04 20:32:52 +04:00
<<: *dind_definition
stage: build_deps
2016-09-08 21:13:10 +04:00
script:
2017-08-04 20:32:52 +04:00
## Building dependencies...
- ./scripts/ci/create_docker_image.build_deps.sh
"${build_deps_image}" "${CI_COMMIT_SHA}"
"${opam_image}:alpine-${alpine_version}_ocaml-${ocaml_version}"
"yes"
.build_deps_template: &build_deps_definition
image: ${build_deps_image}:${CI_COMMIT_SHA}
before_script:
2018-02-05 23:08:28 +04:00
- opam list
tags:
- gitlab-org
## Tezos
build:
<<: *build_deps_definition
stage: build
2018-01-30 02:23:52 +04:00
except:
- master
- alphanet
- zeronet
script:
- make all
- make build-test
artifacts:
paths:
- _build
expire_in: 1 day
2017-08-04 20:32:52 +04:00
## Basic tests (run on merge requests)
2017-08-04 20:32:52 +04:00
.test_template: &test_definition
<<: *build_deps_definition
2017-08-04 20:32:52 +04:00
stage: test
except:
- master
- alphanet
- zeronet
2017-08-04 20:32:52 +04:00
dependencies:
- build
2016-09-08 21:13:10 +04:00
test:opam_packaging:
2018-01-23 16:51:36 +04:00
<<: *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:
2017-08-04 20:32:52 +04:00
<<: *test_definition
2016-09-08 21:13:10 +04:00
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
2016-09-08 21:13:10 +04:00
test:shell:
2017-08-04 20:32:52 +04:00
<<: *test_definition
2016-09-08 21:13:10 +04:00
script:
- jbuilder build @src/lib_shell/runtest
2017-03-31 03:17:25 +04:00
2017-04-05 20:24:26 +04:00
test:p2p:io-scheduler:
2017-08-04 20:32:52 +04:00
<<: *test_definition
2017-03-31 03:17:25 +04:00
script:
- jbuilder build @src/lib_p2p/runtest_p2p_io_scheduler
2016-10-19 17:09:00 +04:00
test:p2p:socket:
2017-08-04 20:32:52 +04:00
<<: *test_definition
2017-01-14 16:14:22 +04:00
script:
- jbuilder build @src/lib_p2p/runtest_p2p_socket
2017-01-14 16:14:22 +04:00
test:p2p:pool:
2017-08-04 20:32:52 +04:00
<<: *test_definition
2017-01-14 16:14:22 +04:00
script:
- jbuilder build @src/lib_p2p/runtest_p2p_pool
2017-01-14 16:14:22 +04:00
test:proto_alpha:
2018-02-01 02:30:50 +04:00
<<: *test_definition
script:
- jbuilder build @src/proto_alpha/lib_protocol/runtest
2018-02-01 02:30:50 +04:00
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:transaction:
# <<: *test_definition
# script:
# - jbuilder build @src/proto_alpha/lib_baking/runtest_transaction
# test:client_alpha:origination:
# <<: *test_definition
# script:
# - jbuilder build @src/proto_alpha/lib_baking/runtest_origination
test:client_alpha:endorsement:
2017-08-04 20:32:52 +04:00
<<: *test_definition
script:
- jbuilder build @src/proto_alpha/lib_baking/runtest_endorsement
test:client_alpha:vote:
2017-08-04 20:32:52 +04:00
<<: *test_definition
script:
- jbuilder build @src/proto_alpha/lib_baking/runtest_vote
2017-04-05 20:24:26 +04:00
test:basic.sh:
2017-08-04 20:32:52 +04:00
<<: *test_definition
2017-01-14 16:14:22 +04:00
script:
- jbuilder build @src/bin_client/runtest_basic.sh
2017-03-05 05:15:14 +04:00
2017-07-24 21:06:40 +04:00
test:contracts.sh:
2017-08-04 20:32:52 +04:00
<<: *test_definition
2017-07-24 21:06:40 +04:00
script:
- jbuilder build @src/bin_client/runtest_contracts.sh
2017-07-24 21:06:40 +04:00
2017-08-09 18:09:41 +04:00
test:multinode.sh:
<<: *test_definition
script:
- jbuilder build @src/bin_client/runtest_multinode.sh
2017-08-09 18:09:41 +04:00
test:inject.sh:
<<: *test_definition
script:
- jbuilder build @src/bin_client/runtest_injection.sh
2017-11-27 09:13:12 +04:00
test:proto:sandbox:
<<: *test_definition
script:
2017-11-27 09:13:12 +04:00
- jbuilder build @runtest_sandbox
## Basic tests through opam packaged (run on master only)
.opam_template: &opam_definition
image: ${opam_image}
stage: opam
dependencies: []
only:
- master
- /^.*opam.*$/
script:
- ./scripts/opam-pin.sh
- opam depext --yes ${package}
2018-02-05 23:08:28 +04:00
- opam install --yes ${package}
- opam reinstall --yes --with-test ${package}
tags:
- gitlab-org
2018-01-23 16:51:36 +04:00
##BEGIN_OPAM##
opam:00:ocplib-json-typed:
<<: *opam_definition
variables:
package: ocplib-json-typed
2018-05-04 21:46:32 +04:00
opam:01:ocplib-json-typed-bson:
<<: *opam_definition
variables:
package: ocplib-json-typed-bson
opam:02:tezos-stdlib:
<<: *opam_definition
variables:
2018-01-23 16:51:36 +04:00
package: tezos-stdlib
2018-05-04 21:46:32 +04:00
opam:03:tezos-data-encoding:
<<: *opam_definition
variables:
package: tezos-data-encoding
2018-05-04 21:46:32 +04:00
opam:04:ocplib-resto:
<<: *opam_definition
variables:
package: ocplib-resto
2018-05-04 21:46:32 +04:00
opam:05:tezos-error-monad:
2018-04-19 16:29:27 +04:00
<<: *opam_definition
variables:
package: tezos-error-monad
2018-05-04 21:46:32 +04:00
opam:06:ocplib-resto-directory:
2018-04-19 16:29:27 +04:00
<<: *opam_definition
variables:
package: ocplib-resto-directory
2018-05-04 21:46:32 +04:00
opam:07:blake2:
<<: *opam_definition
variables:
package: blake2
2018-05-06 16:59:41 +04:00
opam:08:hacl:
2018-05-04 21:46:32 +04:00
<<: *opam_definition
variables:
2018-05-06 16:59:41 +04:00
package: hacl
2018-05-04 21:46:32 +04:00
2018-05-06 16:59:41 +04:00
opam:09:secp256k1:
<<: *opam_definition
variables:
2018-05-06 16:59:41 +04:00
package: secp256k1
2018-05-06 16:59:41 +04:00
opam:10:tezos-clic:
<<: *opam_definition
variables:
2018-05-06 16:59:41 +04:00
package: tezos-clic
2018-05-06 16:59:41 +04:00
opam:11:tezos-rpc:
<<: *opam_definition
variables:
2018-05-06 16:59:41 +04:00
package: tezos-rpc
2018-05-04 21:46:32 +04:00
opam:12:tezos-crypto:
<<: *opam_definition
variables:
2018-04-19 16:29:27 +04:00
package: tezos-crypto
2018-05-04 21:46:32 +04:00
opam:13:tezos-micheline:
<<: *opam_definition
variables:
2018-04-19 16:29:27 +04:00
package: tezos-micheline
2018-05-24 15:32:15 +04:00
opam:14:pbkdf:
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: pbkdf
2018-05-24 15:32:15 +04:00
opam:15:ocplib-resto-cohttp:
2018-02-16 17:33:10 +04:00
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: ocplib-resto-cohttp
2018-02-16 17:33:10 +04:00
2018-05-24 15:32:15 +04:00
opam:16:tezos-base:
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: tezos-base
2018-05-04 21:46:32 +04:00
opam:17:irmin-leveldb:
2018-02-02 19:26:02 +04:00
<<: *opam_definition
variables:
package: irmin-leveldb
2018-02-02 19:26:02 +04:00
2018-05-24 15:32:15 +04:00
opam:18:bip39:
2018-04-03 13:39:09 +04:00
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: bip39
2018-04-03 13:39:09 +04:00
2018-05-24 15:32:15 +04:00
opam:19:tezos-rpc-http:
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: tezos-rpc-http
2018-05-24 15:32:15 +04:00
opam:20:tezos-shell-services:
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: tezos-shell-services
2018-05-24 15:32:15 +04:00
opam:21:tezos-stdlib-unix:
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: tezos-stdlib-unix
2018-05-24 15:32:15 +04:00
opam:22:tezos-storage:
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: tezos-storage
2018-05-24 15:32:15 +04:00
opam:23:tezos-protocol-environment-sigs:
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: tezos-protocol-environment-sigs
2018-05-24 15:32:15 +04:00
opam:24:tezos-client-base:
<<: *opam_definition
variables:
package: tezos-client-base
opam:25:tezos-protocol-compiler:
<<: *opam_definition
variables:
2018-02-02 19:26:02 +04:00
package: tezos-protocol-compiler
2018-05-24 15:32:15 +04:00
opam:26:tezos-signer-services:
<<: *opam_definition
variables:
2018-05-24 15:32:15 +04:00
package: tezos-signer-services
2018-05-24 15:32:15 +04:00
opam:27:tezos-protocol-alpha:
<<: *opam_definition
variables:
2018-02-02 19:26:02 +04:00
package: tezos-protocol-alpha
2018-05-24 15:32:15 +04:00
opam:28:tezos-protocol-environment:
<<: *opam_definition
variables:
package: tezos-protocol-environment
2018-05-24 15:32:15 +04:00
opam:29:tezos-signer-backends:
<<: *opam_definition
variables:
package: tezos-signer-backends
opam:30:tezos-client-alpha:
<<: *opam_definition
variables:
package: tezos-client-alpha
2018-05-24 15:32:15 +04:00
opam:31:tezos-client-commands:
<<: *opam_definition
variables:
package: tezos-client-commands
2018-05-24 15:32:15 +04:00
opam:32:tezos-protocol-environment-shell:
2018-04-03 13:39:09 +04:00
<<: *opam_definition
variables:
package: tezos-protocol-environment-shell
2018-05-24 15:32:15 +04:00
opam:33:tezos-baking-alpha:
<<: *opam_definition
variables:
package: tezos-baking-alpha
2018-05-24 15:32:15 +04:00
opam:34:tezos-protocol-genesis:
<<: *opam_definition
variables:
package: tezos-protocol-genesis
2018-05-24 15:32:15 +04:00
opam:35:ocplib-resto-json:
<<: *opam_definition
variables:
2018-04-03 13:39:09 +04:00
package: ocplib-resto-json
2018-05-24 15:32:15 +04:00
opam:36:tezos-protocol-updater:
<<: *opam_definition
variables:
2018-04-03 13:39:09 +04:00
package: tezos-protocol-updater
2018-05-24 15:32:15 +04:00
opam:37:tezos-p2p:
<<: *opam_definition
variables:
2018-04-03 13:39:09 +04:00
package: tezos-p2p
2018-05-24 15:32:15 +04:00
opam:38:tezos-baking-alpha-commands:
2018-01-23 16:51:36 +04:00
<<: *opam_definition
variables:
package: tezos-baking-alpha-commands
2018-05-24 15:32:15 +04:00
opam:39:tezos-client-alpha-commands:
<<: *opam_definition
variables:
package: tezos-client-alpha-commands
2018-01-29 04:26:41 +04:00
2018-05-24 15:32:15 +04:00
opam:40:tezos-client-base-unix:
<<: *opam_definition
variables:
package: tezos-client-base-unix
2018-05-24 15:32:15 +04:00
opam:41:tezos-client-genesis:
2018-01-29 04:26:41 +04:00
<<: *opam_definition
variables:
2018-02-02 19:26:02 +04:00
package: tezos-client-genesis
2018-01-23 16:51:36 +04:00
2018-05-24 15:32:15 +04:00
opam:42:ocplib-ezresto:
2018-04-03 13:39:09 +04:00
<<: *opam_definition
variables:
package: ocplib-ezresto
2018-05-24 15:32:15 +04:00
opam:43:lmdb:
<<: *opam_definition
variables:
package: lmdb
opam:44:tezos-embedded-protocol-alpha:
<<: *opam_definition
variables:
2018-02-02 19:26:02 +04:00
package: tezos-embedded-protocol-alpha
2018-05-24 15:32:15 +04:00
opam:45:tezos-embedded-protocol-demo:
<<: *opam_definition
variables:
2018-02-02 19:26:02 +04:00
package: tezos-embedded-protocol-demo
2018-05-24 15:32:15 +04:00
opam:46:tezos-embedded-protocol-genesis:
2018-01-29 04:26:41 +04:00
<<: *opam_definition
variables:
2018-02-02 19:26:02 +04:00
package: tezos-embedded-protocol-genesis
2018-01-29 04:26:41 +04:00
2018-05-24 15:32:15 +04:00
opam:47:tezos-shell:
<<: *opam_definition
variables:
package: tezos-shell
2018-05-24 15:32:15 +04:00
opam:48:tezos-client:
<<: *opam_definition
variables:
package: tezos-client
2018-05-24 15:32:15 +04:00
opam:49:ocplib-ezresto-directory:
<<: *opam_definition
variables:
2018-04-03 13:39:09 +04:00
package: ocplib-ezresto-directory
2018-05-24 15:32:15 +04:00
opam:50:tezos-baker-alpha:
<<: *opam_definition
variables:
package: tezos-baker-alpha
2018-05-24 15:32:15 +04:00
opam:51:tezos-protocol-demo:
<<: *opam_definition
variables:
package: tezos-protocol-demo
2018-05-24 15:32:15 +04:00
opam:52:tezos-signer:
<<: *opam_definition
variables:
package: tezos-signer
2018-05-24 15:32:15 +04:00
opam:53:tezos-node:
<<: *opam_definition
variables:
2018-04-03 13:39:09 +04:00
package: tezos-node
2018-05-24 15:32:15 +04:00
opam:54:ocplib-json-typed-browser:
<<: *opam_definition
variables:
package: ocplib-json-typed-browser
2018-01-23 16:51:36 +04:00
##END_OPAM##
2017-08-04 20:32:52 +04:00
## Publishing (small) docker images with tezos binaries
2017-01-14 16:14:22 +04:00
2017-08-04 20:32:52 +04:00
publish:docker:minimal:
<<: *dind_definition
stage: publish
2017-03-05 05:15:14 +04:00
only:
- master
- alphanet
- zeronet
2017-03-09 17:43:59 +04:00
script:
2018-01-30 01:11:18 +04:00
- ./scripts/ci/create_docker_image.build.sh
"tezos_build" "${CI_COMMIT_REF_NAME}"
"${build_deps_image}:${CI_COMMIT_SHA}"
2018-01-30 01:11:18 +04:00
- ./scripts/ci/create_docker_image.minimal.sh
"${public_docker_image}" "${CI_COMMIT_REF_NAME}"
"tezos_build:${CI_COMMIT_REF_NAME}"
2017-08-17 21:26:13 +04:00
- mkdir ~/.docker || true
- echo "${CI_DOCKER_AUTH}" > ~/.docker/config.json ;
- docker push "${public_docker_image}:${CI_COMMIT_REF_NAME}"
2017-03-09 17:43:59 +04:00
2017-08-04 20:32:52 +04:00
## Publish to github...
2017-03-09 17:43:59 +04:00
publish:github:
image: ${opam_image}
stage: publish
dependencies: []
2016-09-08 21:13:10 +04:00
only:
- master@tezos/tezos
2017-08-04 20:32:52 +04:00
- alphanet@tezos/tezos
2016-09-08 21:13:10 +04:00
script:
- echo "${CI_KH}" > ~/.ssh/known_hosts
- echo "${CI_PK_GITHUB}" > ~/.ssh/id_rsa
2016-09-08 21:13:10 +04:00
- chmod 400 ~/.ssh/id_rsa
- rm -fr .git/refs/original
2018-01-30 01:11:18 +04:00
- sudo apk add --no-cache openssh
- git push git@github.com:tezos/tezos.git -f HEAD:${CI_COMMIT_REF_NAME}
tags:
- gitlab-org
2016-09-08 21:13:10 +04:00
## Publish docs to gitlab...
2018-02-06 03:46:46 +04:00
pages:
image: ${build_deps_image}:${CI_COMMIT_SHA}
stage: publish
only:
- master@tezos/tezos
artifacts:
paths:
- public
script:
2018-01-30 02:22:56 +04:00
- sudo apk add --no-cache py3-sphinx py3-sphinx_rtd_theme
- sudo ln -s /usr/bin/sphinx-build-3 /usr/bin/sphinx-build
2018-01-30 01:54:20 +04:00
- opam install --yes odoc
- make doc-html && sudo mv docs/_build "${CI_PROJECT_DIR}"/public
tags:
- gitlab-org
documentation:
image: ${build_deps_image}:${CI_COMMIT_SHA}
stage: test
only:
- /^.*doc.*$/
script:
- sudo apk add --no-cache py3-sphinx py3-sphinx_rtd_theme
- sudo ln -s /usr/bin/sphinx-build-3 /usr/bin/sphinx-build
- opam install --yes odoc
- make doc-html
tags:
- gitlab-org
## Relaunching the bootstrap servers of the alphanet/zeronet
.bootstrap_template: &bootstrap_definition
image: ${opam_image}
2017-03-09 17:43:59 +04:00
stage: deploy
dependencies: []
before_script:
2017-03-09 17:43:59 +04:00
- echo "${CI_KH}" > ~/.ssh/known_hosts
- echo "${CI_PK_ALPHANET}" | tr -d "\r" > ~/.ssh/id_ed25519 ;
- echo "${CI_SSH_CONFIG}" | tr -d "\r" > ~/.ssh/config
2017-07-06 20:09:09 +04:00
- chmod 600 ~/.ssh/id_ed25519
- sudo apk add --no-cache openssh
2017-03-09 17:43:59 +04:00
allow_failure: true
tags:
- gitlab-org
2017-03-09 17:43:59 +04:00
deploy:bootstrap1:
<<: *bootstrap_definition
only:
- alphanet@tezos/tezos
2017-03-09 17:43:59 +04:00
script:
- ssh bootstrap1
deploy:bootstrap2:
<<: *bootstrap_definition
only:
- alphanet@tezos/tezos
script:
- ssh bootstrap2
deploy:bootstrap3:
<<: *bootstrap_definition
only:
- alphanet@tezos/tezos
script:
- ssh bootstrap3
deploy:bootstrap4:
<<: *bootstrap_definition
only:
- alphanet@tezos/tezos
script:
- ssh bootstrap4
deploy:bootstrap5:
<<: *bootstrap_definition
only:
- alphanet@tezos/tezos
script:
- ssh bootstrap5
deploy:bootstrap6:
<<: *bootstrap_definition
only:
- alphanet@tezos/tezos
script:
- ssh bootstrap6
deploy:zeronet1:
<<: *bootstrap_definition
only:
- zeronet@tezos/tezos
script:
- ssh zeronet1
deploy:zeronet2:
<<: *bootstrap_definition
only:
- zeronet@tezos/tezos
script:
- ssh zeronet2
deploy:zeronet3:
<<: *bootstrap_definition
only:
- zeronet@tezos/tezos
script:
- ssh zeronet3
2017-08-16 16:18:34 +04:00
# cleanup:
# <<: *dind_definition
# stage: cleanup
# dependencies: []
2017-08-16 16:18:34 +04:00
# script:
# - ./scripts/ci/docker_registry_delete.sh
# "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}"
# "${build_deps_image}" "${CI_COMMIT_SHA}"