swh:1:snp:9c27352633c4639a943e316050a7b904f57900e2
Raw File
Tip revision: 8cdee3e1ae62e959ead280f83e1a7874f92accce authored by Pierre Boutillier on 08 June 2020, 19:01:29 UTC
Merge branch 'multisig-failure' into 'master'
Tip revision: 8cdee3e
.gitlab-ci.yml
variables:
  ## Please update `scripts/version.sh` accordingly
  build_deps_image_version: f9f3b9f7cd60a54f06836cca466a19f562c9b833
  build_deps_image_name: registry.gitlab.com/tezos/opam-repository
  public_docker_image_name: docker.io/${CI_PROJECT_PATH}
  GIT_STRATEGY: fetch
  GIT_DEPTH: "1"
  GET_SOURCES_ATTEMPTS: "2"
  ARTIFACT_DOWNLOAD_ATTEMPTS: "2"

stages:
  - test_coverage
  - publish_coverage
  - 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
    - zeronet
    - mainnet
    - zeronet-staging
    - mainnet-staging
    - zeronet-snapshots
    - mainnet-snapshots
  before_script:
    - . ./scripts/version.sh

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'." ;
        echo "${build_deps_image_version} != ${opam_repository_tag}" ;
        exit 1 ;
      fi
    - ./scripts/opam-check.sh
    - ./scripts/check_opam_test.sh

check_opam_lint:
  <<: *build_definition
  script:
    - find . ! -path "./_opam/*" -name "*.opam" -exec opam lint {} +;

check_linting:
  <<: *build_definition
  script:
    - make check-linting

check_python_linting:
  <<: *build_definition
  script:
    - make check-python-linting

check_python_types:
  <<: *build_definition
  script:
    - make -C tests_python typecheck

build:
  <<: *build_definition
  script:
    - . ./scripts/version.sh
    - dune build @runtest_dune_template
    - make all build-test
    - opam clean
  cache:
    key: "${CI_COMMIT_REF_SLUG}"
    paths:
      - _build
  artifacts:
    name: "$CI_COMMIT_REF_NAME"
    paths:
      - _build
    expire_in: 1 day

############################################################
## Stage: test (only MR)                                  ##
############################################################

.test_template: &test_definition
  <<: *build_definition
  stage: test
  dependencies:
    - build
  retry: 2

# this section is updated using the script scripts/update_unit_test.sh
##BEGIN_UNITEST##
unit:shell:
  <<: *test_definition
  script:
    - dune build @src/lib_shell/runtest

unit:client_base:
  <<: *test_definition
  script:
    - dune build @src/lib_client_base/runtest

unit:requester:
  <<: *test_definition
  script:
    - dune build @src/lib_requester/runtest

unit:error_monad:
  <<: *test_definition
  script:
    - dune build @src/lib_error_monad/runtest

unit:src/proto_006_PsCARTHA/lib_client:
  <<: *test_definition
  script:
    - dune build @src/proto_006_PsCARTHA/lib_client/runtest

unit:src/proto_006_PsCARTHA/lib_protocol:
  <<: *test_definition
  script:
    - dune build @src/proto_006_PsCARTHA/lib_protocol/runtest

unit:src/proto_alpha/lib_client:
  <<: *test_definition
  script:
    - dune build @src/proto_alpha/lib_client/runtest

unit:src/proto_alpha/lib_protocol:
  <<: *test_definition
  script:
    - dune build @src/proto_alpha/lib_protocol/runtest

unit:crypto:
  <<: *test_definition
  script:
    - dune build @src/lib_crypto/runtest

unit:stdlib:
  <<: *test_definition
  script:
    - dune build @src/lib_stdlib/runtest

unit:storage:
  <<: *test_definition
  script:
    - dune build @src/lib_storage/runtest

unit:p2p:
  <<: *test_definition
  script:
    - dune build @src/lib_p2p/runtest

unit:micheline:
  <<: *test_definition
  script:
    - dune build @src/lib_micheline/runtest

unit:protocol_environment:
  <<: *test_definition
  script:
    - dune build @src/lib_protocol_environment/runtest

unit:signer_backends/unix:
  <<: *test_definition
  script:
    - dune build @src/lib_signer_backends/unix/runtest

unit:signer_backends:
  <<: *test_definition
  script:
    - dune build @src/lib_signer_backends/runtest

unit:src/bin_client:
  <<: *test_definition
  script:
    - dune build @src/bin_client/runtest

unit:ocaml-uecc:
  <<: *test_definition
  script:
    - dune build @vendors/ocaml-uecc/runtest

unit:ocaml-ledger-wallet:
  <<: *test_definition
  script:
    - dune build @vendors/ocaml-ledger-wallet/runtest

unit:ocaml-secp256k1:
  <<: *test_definition
  script:
    - dune build @vendors/ocaml-secp256k1/runtest

unit:ocaml-lmdb:
  <<: *test_definition
  script:
    - dune build @vendors/ocaml-lmdb/runtest


##END_UNITEST##

unit:protocol_compiles:
  <<: *test_definition
  script:
    - dune build @runtest_compile_protocol

############################################################
## Stage: run shell integration tests                     ##
############################################################

# definition for the environment to run all integration tests
.integration_template: &integration_definition
  <<: *test_definition
  dependencies:
    - build
  before_script:
    - make

integration:proto:sandbox:
  <<: *integration_definition
  script:
    - dune build @runtest_sandbox

############################################################
## Stage: run OCaml integration tests                     ##
############################################################

integration:sandboxes:voting:
  <<: *integration_definition
  script:
    - ROOT_PATH=$PWD/flextesa-voting-demo-noops dune build @src/bin_sandbox/runtest_sandbox_voting_demo_noops
  artifacts:
    paths:
    - flextesa-voting-demo-noops
    expire_in: 1 day
    when: on_failure
  allow_failure: true # This test uses too much resources for GitLab's workers

integration:sandboxes:acc-baking:
  <<: *integration_definition
  script:
    - ROOT_PATH=$PWD/flextesa-acc-sdb dune build @src/bin_sandbox/runtest_sandbox_accusations_simple_double_baking
  artifacts:
    paths:
    - flextesa-acc-sdb
    expire_in: 1 day
    when: on_failure

integration:sandboxes:acc-endorsement:
  <<: *integration_definition
  script:
    - ROOT_PATH=$PWD/flextesa-acc-sde dune build @src/bin_sandbox/runtest_sandbox_accusations_simple_double_endorsing
  artifacts:
    paths:
    - flextesa-acc-sde
    expire_in: 1 day
    when: on_failure

integration:sandboxes:u-a-u:
  <<: *integration_definition
  script:
    - ROOT_PATH=$PWD/flextesa-hard-fork dune build @src/bin_sandbox/runtest_sandbox_user_activated_upgrade
  artifacts:
    paths:
    - flextesa-hard-fork
    expire_in: 1 day
    when: on_failure

integration:sandboxes:daemons-upgrade:
  <<: *integration_definition
  script:
    - ROOT_PATH=$PWD/flextesa-daemons-upgrade dune build @src/bin_sandbox/runtest_sandbox_daemons_upgrade
  artifacts:
    paths:
    - flextesa-daemons-upgrade
    expire_in: 1 day
    when: on_failure

############################################################
## Stage: run python integration tests                    ##
############################################################

# definition for the environment to run all integration tests
.integration_template: &integration_python_definition
  <<: *test_definition
  dependencies:
    - build
  before_script:
    - make
    - mkdir tmp
  after_script:
    - tail -n +1 tmp/*

# this section is updated using the script scripts/update_integration_test.sh
##BEGIN_INTEGRATION_PYTHON##
integration:baker_endorser:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_baker_endorser.py -s --log-dir=tmp
  stage: test

integration:basic:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_basic.py -s --log-dir=tmp
  stage: test

integration:bootstrap:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_bootstrap.py -s --log-dir=tmp
  stage: test

integration:contract:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_contract.py -s --log-dir=tmp
  stage: test

integration:contract_annotations:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_contract_annotations.py -s --log-dir=tmp
  stage: test

integration:contract_baker:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_contract_baker.py -s --log-dir=tmp
  stage: test

integration:contract_legacy:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_contract_legacy.py -s --log-dir=tmp
  stage: test

integration:contract_macros:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_contract_macros.py -s --log-dir=tmp
  stage: test

integration:contract_onchain_opcodes:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_contract_onchain_opcodes.py -s --log-dir=tmp
  stage: test

integration:contract_opcodes:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_contract_opcodes.py -s --log-dir=tmp
  stage: test

integration:cors:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_cors.py -s --log-dir=tmp
  stage: test

integration:double_endorsement:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_double_endorsement.py -s --log-dir=tmp
  stage: test

integration:fork:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_fork.py -s --log-dir=tmp
  stage: test

integration:injection:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_injection.py -s --log-dir=tmp
  stage: test

integration:many_bakers:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_many_bakers.py -s --log-dir=tmp
  stage: test

integration:many_nodes:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_many_nodes.py -s --log-dir=tmp
  stage: test

integration:mempool:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_mempool.py -s --log-dir=tmp
  stage: test

integration:multinode:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_multinode.py -s --log-dir=tmp
  stage: test

integration:multinode_snapshot:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_multinode_snapshot.py -s --log-dir=tmp
  stage: test

integration:multinode_storage_reconstruction:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_multinode_storage_reconstruction.py -s --log-dir=tmp
  stage: test

integration:multisig:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_multisig.py -s --log-dir=tmp
  stage: test

integration:p2p:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_p2p.py -s --log-dir=tmp
  stage: test

integration:programs:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_programs.py -s --log-dir=tmp
  stage: test

integration:proto_demo_counter:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_proto_demo_counter.py -s --log-dir=tmp
  stage: test

integration:proto_demo_noops_manual_bake:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_proto_demo_noops_manual_bake.py -s --log-dir=tmp
  stage: test

integration:rpc:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_rpc.py -s --log-dir=tmp
  stage: test

integration:tls:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_tls.py -s --log-dir=tmp
  stage: test

integration:voting:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_voting.py -s --log-dir=tmp
  stage: test

integration:voting_full:
  <<: *integration_python_definition
  script:
    - pytest tests_python/tests/test_voting_full.py -s --log-dir=tmp
  stage: test

integration:examples_forge_transfer:
  <<: *integration_definition
  script:
    - PYTHONPATH=tests_python/ python3 tests_python/examples/forge_transfer.py
  stage: test

integration:examples_example:
  <<: *integration_definition
  script:
    - PYTHONPATH=tests_python/ python3 tests_python/examples/example.py
  stage: test

integration:examples_test_example:
  <<: *integration_definition
  script:
    - pytest tests_python/examples/test_example.py
  stage: test

##END_INTEGRATION_PYTHON##

############################################################
## Stage: run doc integration tests                       ##
############################################################

documentation:build:
  <<: *test_definition
  script:
    - make doc-html
  artifacts:
    paths:
    - docs
    expire_in: 1 week

documentation:linkcheck:
  <<: *test_definition
  script:
    - make doc-html-and-linkcheck
  allow_failure: true

############################################################
## 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: []
  rules:
    - if: '$CI_COMMIT_BRANCH == "master"'
      when: on_success
    - if: '$CI_COMMIT_BRANCH =~ /opam/'
      when: on_success
    - if: '$CI_COMMIT_BRANCH =~ /-release$/'
      when: on_success
    - changes:
      - /**/*.opam
      - /**/dune
      - /**/dune.inc
      - /**/*.dune.inc
      - /scripts/version.sh
      - /.gitlab-ci.yml
      when: on_success
  script:
    - ./scripts/opam-pin.sh
    - opam depext --yes ${package}
    - opam install --yes ${package}
    - opam reinstall --yes --with-test ${package}

##BEGIN_OPAM##
# this section is updated using the script scripts/update_opam_test.sh

opam:flextesa:
  <<: *opam_definition
  variables:
    package: flextesa

opam:index:
  <<: *opam_definition
  variables:
    package: index

opam:irmin:
  <<: *opam_definition
  variables:
    package: irmin

opam:irmin-pack:
  <<: *opam_definition
  variables:
    package: irmin-pack

opam:ledgerwallet:
  <<: *opam_definition
  variables:
    package: ledgerwallet

opam:ledgerwallet-tezos:
  <<: *opam_definition
  variables:
    package: ledgerwallet-tezos

opam:secp256k1-internal:
  <<: *opam_definition
  variables:
    package: secp256k1-internal

opam:tezos-006-PsCARTHA-test-helpers:
  <<: *opam_definition
  variables:
    package: tezos-006-PsCARTHA-test-helpers

opam:tezos-accuser-006-PsCARTHA:
  <<: *opam_definition
  variables:
    package: tezos-accuser-006-PsCARTHA

opam:tezos-accuser-006-PsCARTHA-commands:
  <<: *opam_definition
  variables:
    package: tezos-accuser-006-PsCARTHA-commands

opam:tezos-accuser-alpha:
  <<: *opam_definition
  variables:
    package: tezos-accuser-alpha

opam:tezos-accuser-alpha-commands:
  <<: *opam_definition
  variables:
    package: tezos-accuser-alpha-commands

opam:tezos-alpha-test-helpers:
  <<: *opam_definition
  variables:
    package: tezos-alpha-test-helpers

opam:tezos-baker-006-PsCARTHA:
  <<: *opam_definition
  variables:
    package: tezos-baker-006-PsCARTHA

opam:tezos-baker-alpha:
  <<: *opam_definition
  variables:
    package: tezos-baker-alpha

opam:tezos-baking-006-PsCARTHA:
  <<: *opam_definition
  variables:
    package: tezos-baking-006-PsCARTHA

opam:tezos-baking-006-PsCARTHA-commands:
  <<: *opam_definition
  variables:
    package: tezos-baking-006-PsCARTHA-commands

opam:tezos-baking-alpha:
  <<: *opam_definition
  variables:
    package: tezos-baking-alpha

opam:tezos-baking-alpha-commands:
  <<: *opam_definition
  variables:
    package: tezos-baking-alpha-commands

opam:tezos-base:
  <<: *opam_definition
  variables:
    package: tezos-base

opam:tezos-clic:
  <<: *opam_definition
  variables:
    package: tezos-clic

opam:tezos-client:
  <<: *opam_definition
  variables:
    package: tezos-client

opam:tezos-client-000-Ps9mPmXa:
  <<: *opam_definition
  variables:
    package: tezos-client-000-Ps9mPmXa

opam:tezos-client-001-PtCJ7pwo:
  <<: *opam_definition
  variables:
    package: tezos-client-001-PtCJ7pwo

opam:tezos-client-001-PtCJ7pwo-commands:
  <<: *opam_definition
  variables:
    package: tezos-client-001-PtCJ7pwo-commands

opam:tezos-client-002-PsYLVpVv:
  <<: *opam_definition
  variables:
    package: tezos-client-002-PsYLVpVv

opam:tezos-client-002-PsYLVpVv-commands:
  <<: *opam_definition
  variables:
    package: tezos-client-002-PsYLVpVv-commands

opam:tezos-client-003-PsddFKi3:
  <<: *opam_definition
  variables:
    package: tezos-client-003-PsddFKi3

opam:tezos-client-003-PsddFKi3-commands:
  <<: *opam_definition
  variables:
    package: tezos-client-003-PsddFKi3-commands

opam:tezos-client-004-Pt24m4xi:
  <<: *opam_definition
  variables:
    package: tezos-client-004-Pt24m4xi

opam:tezos-client-004-Pt24m4xi-commands:
  <<: *opam_definition
  variables:
    package: tezos-client-004-Pt24m4xi-commands

opam:tezos-client-005-PsBabyM1:
  <<: *opam_definition
  variables:
    package: tezos-client-005-PsBabyM1

opam:tezos-client-005-PsBabyM1-commands:
  <<: *opam_definition
  variables:
    package: tezos-client-005-PsBabyM1-commands

opam:tezos-client-006-PsCARTHA:
  <<: *opam_definition
  variables:
    package: tezos-client-006-PsCARTHA

opam:tezos-client-006-PsCARTHA-commands:
  <<: *opam_definition
  variables:
    package: tezos-client-006-PsCARTHA-commands

opam:tezos-client-alpha:
  <<: *opam_definition
  variables:
    package: tezos-client-alpha

opam:tezos-client-alpha-commands:
  <<: *opam_definition
  variables:
    package: tezos-client-alpha-commands

opam:tezos-client-base:
  <<: *opam_definition
  variables:
    package: tezos-client-base

opam:tezos-client-base-unix:
  <<: *opam_definition
  variables:
    package: tezos-client-base-unix

opam:tezos-client-commands:
  <<: *opam_definition
  variables:
    package: tezos-client-commands

opam:tezos-client-demo-counter:
  <<: *opam_definition
  variables:
    package: tezos-client-demo-counter

opam:tezos-client-genesis:
  <<: *opam_definition
  variables:
    package: tezos-client-genesis

opam:tezos-client-genesis-carthagenet:
  <<: *opam_definition
  variables:
    package: tezos-client-genesis-carthagenet

opam:tezos-codec:
  <<: *opam_definition
  variables:
    package: tezos-codec

opam:tezos-crypto:
  <<: *opam_definition
  variables:
    package: tezos-crypto

opam:tezos-embedded-protocol-000-Ps9mPmXa:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-000-Ps9mPmXa

opam:tezos-embedded-protocol-001-PtCJ7pwo:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-001-PtCJ7pwo

opam:tezos-embedded-protocol-002-PsYLVpVv:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-002-PsYLVpVv

opam:tezos-embedded-protocol-003-PsddFKi3:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-003-PsddFKi3

opam:tezos-embedded-protocol-004-Pt24m4xi:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-004-Pt24m4xi

opam:tezos-embedded-protocol-005-PsBABY5H:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-005-PsBABY5H

opam:tezos-embedded-protocol-005-PsBabyM1:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-005-PsBabyM1

opam:tezos-embedded-protocol-006-PsCARTHA:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-006-PsCARTHA

opam:tezos-embedded-protocol-alpha:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-alpha

opam:tezos-embedded-protocol-demo-counter:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-demo-counter

opam:tezos-embedded-protocol-demo-noops:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-demo-noops

opam:tezos-embedded-protocol-genesis:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-genesis

opam:tezos-embedded-protocol-genesis-carthagenet:
  <<: *opam_definition
  variables:
    package: tezos-embedded-protocol-genesis-carthagenet

opam:tezos-endorser-006-PsCARTHA:
  <<: *opam_definition
  variables:
    package: tezos-endorser-006-PsCARTHA

opam:tezos-endorser-006-PsCARTHA-commands:
  <<: *opam_definition
  variables:
    package: tezos-endorser-006-PsCARTHA-commands

opam:tezos-endorser-alpha:
  <<: *opam_definition
  variables:
    package: tezos-endorser-alpha

opam:tezos-endorser-alpha-commands:
  <<: *opam_definition
  variables:
    package: tezos-endorser-alpha-commands

opam:tezos-error-monad:
  <<: *opam_definition
  variables:
    package: tezos-error-monad

opam:tezos-event-logging:
  <<: *opam_definition
  variables:
    package: tezos-event-logging

opam:tezos-lmdb:
  <<: *opam_definition
  variables:
    package: tezos-lmdb

opam:tezos-mempool-006-PsCARTHA:
  <<: *opam_definition
  variables:
    package: tezos-mempool-006-PsCARTHA

opam:tezos-mempool-alpha:
  <<: *opam_definition
  variables:
    package: tezos-mempool-alpha

opam:tezos-micheline:
  <<: *opam_definition
  variables:
    package: tezos-micheline

opam:tezos-mockup:
  <<: *opam_definition
  variables:
    package: tezos-mockup

opam:tezos-mockup-commands:
  <<: *opam_definition
  variables:
    package: tezos-mockup-commands

opam:tezos-mockup-registration:
  <<: *opam_definition
  variables:
    package: tezos-mockup-registration

opam:tezos-node:
  <<: *opam_definition
  variables:
    package: tezos-node

opam:tezos-p2p:
  <<: *opam_definition
  variables:
    package: tezos-p2p

opam:tezos-p2p-services:
  <<: *opam_definition
  variables:
    package: tezos-p2p-services

opam:tezos-protocol-000-Ps9mPmXa:
  <<: *opam_definition
  variables:
    package: tezos-protocol-000-Ps9mPmXa

opam:tezos-protocol-001-PtCJ7pwo:
  <<: *opam_definition
  variables:
    package: tezos-protocol-001-PtCJ7pwo

opam:tezos-protocol-002-PsYLVpVv:
  <<: *opam_definition
  variables:
    package: tezos-protocol-002-PsYLVpVv

opam:tezos-protocol-003-PsddFKi3:
  <<: *opam_definition
  variables:
    package: tezos-protocol-003-PsddFKi3

opam:tezos-protocol-004-Pt24m4xi:
  <<: *opam_definition
  variables:
    package: tezos-protocol-004-Pt24m4xi

opam:tezos-protocol-005-PsBABY5H:
  <<: *opam_definition
  variables:
    package: tezos-protocol-005-PsBABY5H

opam:tezos-protocol-005-PsBabyM1:
  <<: *opam_definition
  variables:
    package: tezos-protocol-005-PsBabyM1

opam:tezos-protocol-006-PsCARTHA:
  <<: *opam_definition
  variables:
    package: tezos-protocol-006-PsCARTHA

opam:tezos-protocol-006-PsCARTHA-parameters:
  <<: *opam_definition
  variables:
    package: tezos-protocol-006-PsCARTHA-parameters

opam:tezos-protocol-006-PsCARTHA-tests:
  <<: *opam_definition
  variables:
    package: tezos-protocol-006-PsCARTHA-tests

opam:tezos-protocol-alpha:
  <<: *opam_definition
  variables:
    package: tezos-protocol-alpha

opam:tezos-protocol-alpha-parameters:
  <<: *opam_definition
  variables:
    package: tezos-protocol-alpha-parameters

opam:tezos-protocol-alpha-tests:
  <<: *opam_definition
  variables:
    package: tezos-protocol-alpha-tests

opam:tezos-protocol-compiler:
  <<: *opam_definition
  variables:
    package: tezos-protocol-compiler

opam:tezos-protocol-demo-counter:
  <<: *opam_definition
  variables:
    package: tezos-protocol-demo-counter

opam:tezos-protocol-demo-noops:
  <<: *opam_definition
  variables:
    package: tezos-protocol-demo-noops

opam:tezos-protocol-environment:
  <<: *opam_definition
  variables:
    package: tezos-protocol-environment

opam:tezos-protocol-environment-packer:
  <<: *opam_definition
  variables:
    package: tezos-protocol-environment-packer

opam:tezos-protocol-environment-sigs:
  <<: *opam_definition
  variables:
    package: tezos-protocol-environment-sigs

opam:tezos-protocol-environment-structs:
  <<: *opam_definition
  variables:
    package: tezos-protocol-environment-structs

opam:tezos-protocol-genesis:
  <<: *opam_definition
  variables:
    package: tezos-protocol-genesis

opam:tezos-protocol-genesis-carthagenet:
  <<: *opam_definition
  variables:
    package: tezos-protocol-genesis-carthagenet

opam:tezos-protocol-updater:
  <<: *opam_definition
  variables:
    package: tezos-protocol-updater

opam:tezos-requester:
  <<: *opam_definition
  variables:
    package: tezos-requester

opam:tezos-rpc:
  <<: *opam_definition
  variables:
    package: tezos-rpc

opam:tezos-rpc-http:
  <<: *opam_definition
  variables:
    package: tezos-rpc-http

opam:tezos-rpc-http-client:
  <<: *opam_definition
  variables:
    package: tezos-rpc-http-client

opam:tezos-rpc-http-client-unix:
  <<: *opam_definition
  variables:
    package: tezos-rpc-http-client-unix

opam:tezos-rpc-http-server:
  <<: *opam_definition
  variables:
    package: tezos-rpc-http-server

opam:tezos-shell:
  <<: *opam_definition
  variables:
    package: tezos-shell

opam:tezos-shell-context:
  <<: *opam_definition
  variables:
    package: tezos-shell-context

opam:tezos-shell-services:
  <<: *opam_definition
  variables:
    package: tezos-shell-services

opam:tezos-signer:
  <<: *opam_definition
  variables:
    package: tezos-signer

opam:tezos-signer-backends:
  <<: *opam_definition
  variables:
    package: tezos-signer-backends

opam:tezos-signer-services:
  <<: *opam_definition
  variables:
    package: tezos-signer-services

opam:tezos-stdlib:
  <<: *opam_definition
  variables:
    package: tezos-stdlib

opam:tezos-stdlib-unix:
  <<: *opam_definition
  variables:
    package: tezos-stdlib-unix

opam:tezos-storage:
  <<: *opam_definition
  variables:
    package: tezos-storage

opam:tezos-test-services:
  <<: *opam_definition
  variables:
    package: tezos-test-services

opam:tezos-tooling:
  <<: *opam_definition
  variables:
    package: tezos-tooling

opam:tezos-validation:
  <<: *opam_definition
  variables:
    package: tezos-validation

opam:tezos-validator:
  <<: *opam_definition
  variables:
    package: tezos-validator

opam:tezos-version:
  <<: *opam_definition
  variables:
    package: tezos-version

opam:tezos-workers:
  <<: *opam_definition
  variables:
    package: tezos-workers

opam:uecc:
  <<: *opam_definition
  variables:
    package: uecc


##END_OPAM##



############################################################
## Stage: publish                                         ##
############################################################

publish:docker:
  image: docker:latest
  services:
    - docker:dind
  variables:
    DOCKER_DRIVER: overlay2
  stage: publish
  only:
    - master@tezos/tezos
    - tags@tezos/tezos
    - /-release$/@tezos/tezos
    - zeronet@tezos/tezos
    - mainnet@tezos/tezos
    - zeronet-staging@tezos/tezos
    - mainnet-staging@tezos/tezos
    - zeronet-snapshots@tezos/tezos
    - mainnet-snapshots@tezos/tezos
  before_script:
    - apk add git binutils
    - mkdir ~/.docker || true
    - echo "${CI_DOCKER_AUTH}" > ~/.docker/config.json
  script:
    - LAST_COMMIT_DATE_TIME=$(git log --pretty=format:"%cd" -1 --date="format:%Y%m%d%H%M%S" 2>&1)
    - ./scripts/create_docker_image.sh
        "${public_docker_image_name}"
        "${CI_COMMIT_REF_NAME}"
        "${build_deps_image_name}"
        "${build_deps_image_version}"
        "${CI_COMMIT_SHORT_SHA}"
    - docker push "${public_docker_image_name}:${CI_COMMIT_REF_NAME}"
    - docker push "${public_docker_image_name}-bare:${CI_COMMIT_REF_NAME}"
    - docker push "${public_docker_image_name}-debug:${CI_COMMIT_REF_NAME}"
    - docker tag
      "${public_docker_image_name}:${CI_COMMIT_REF_NAME}"
      "${public_docker_image_name}:${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHORT_SHA}_${LAST_COMMIT_DATE_TIME}"
    - docker tag
      "${public_docker_image_name}-bare:${CI_COMMIT_REF_NAME}"
      "${public_docker_image_name}-bare:${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHORT_SHA}_${LAST_COMMIT_DATE_TIME}"
    - docker tag
      "${public_docker_image_name}-debug:${CI_COMMIT_REF_NAME}"
      "${public_docker_image_name}-debug:${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHORT_SHA}_${LAST_COMMIT_DATE_TIME}"
    - docker push "${public_docker_image_name}:${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHORT_SHA}_${LAST_COMMIT_DATE_TIME}"
    - docker push "${public_docker_image_name}-bare:${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHORT_SHA}_${LAST_COMMIT_DATE_TIME}"
    - docker push "${public_docker_image_name}-debug:${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHORT_SHA}_${LAST_COMMIT_DATE_TIME}"
  tags:
    - safe_docker

publish:doc:
  image: ${build_deps_image_name}:${build_deps_image_version}
  stage: doc
  only:
    - master@tezos/tezos
  before_script:
    - sudo apk add --no-cache openssh-client rsync
    - 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 --depth 5 git@gitlab.com:${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAMESPACE}.gitlab.io gitlab.io
    - rsync --recursive --links --perms --delete --verbose
        --exclude=.doctrees --exclude={{main,alpha,zero}net,master}/index.html
        docs/_build/ gitlab.io/public/
    - cd gitlab.io
    - if [ -z "$(git status -s)" ] ; then
        echo "Nothing to commit!" ;
      else
        git add public ;
        git commit -m "Import doc of ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_SHA}" ;
        git push origin master ;
      fi

# This job publishes the html report generated by the coverage job.
# It is accessible on the gitlab page associated to the project
# via URL $CI_PAGES_URL/$CI_PIPELINE_ID
#
# for instance https://nomadic-labs.gitlab.io/tezos/${CI_PIPELINE_ID}
# https://tezos.gitlab.io/tezos/${CI_PIPELINE_ID}
#
# It is run manually from the Gitlab CI interface.
#
# Note that this job is somewhat redundant. It is already possible to browse
# the html report artefact generated by the test_coverage job.
#

pages:
  when: manual
  # The cache rule ensures public (i.e. the static website) isn't erased
  # whenever we start a new pipeline
  # https://docs.gitlab.com/ee/ci/caching/
  # The pages job retrieves the old public dir from the cache, adds a new
  # report, and publishes the new public dir.
  cache:
    paths:
      - public
  stage: publish_coverage
  dependencies:
    - test_coverage
  script:
    - mkdir -p public
    - mv _coverage_report public/$CI_PIPELINE_ID
    - echo "Coverage report published at $CI_PAGES_URL/$CI_PIPELINE_ID"
  artifacts:
    paths:
      - public
    # This is the minimum time the public artifact will remain available.
    # Everytime a pages job is launched, this time period is reset
    expire_in: 7 days

############################################################
## Stage: coverage                                        ##
############################################################

# This job is manual. It can be launched from the gitlab CI interface.
# It instruments the code with bisect_ppx and runs the full test suite
# (sequentially).

test_coverage:
  image: ${build_deps_image_name}:${build_deps_image_version}
  stage: test_coverage
  when: manual
  variables:
    # We exclude from coverage old protocols and code that can't be
    # instrumented because of current limitations of bisect_ppx.
    OLD_PROTOCOLS: "src/proto_000_Ps9mPmXa src/proto_001_PtCJ7pwo src/proto_002_PsYLVpVv src/proto_003_PsddFKi3 src/proto_004_Pt24m4xi src/proto_005_PsBABY5H src/proto_005_PsBabyM1 src/proto_006_PsCARTHA"
    # TODO try with future version, didn't work with bisect_ppx 2.4.1
    NOT_INSTRUMENTABLE: "src/lib_crypto"
    COVERAGE_EXCLUDE: "$OLD_PROTOCOLS $NOT_INSTRUMENTABLE"
  script:
    - scripts/instrument_dune_bisect.sh src/ --except $COVERAGE_EXCLUDE
    - make
    # A failing test shouldn't prevent the generation of the report (|| true)
    - dune build @runtest || true
    - make -C tests_python all || true
    - make coverage-report
    - make coverage-report-summary
    # hack to capture script success in after_script script
    - touch $CI_PROJECT_DIR/__success
  after_script:
    - |
      if [ ! -f __success ]; then
        echo "Job was unable to generate the coverage report."
        echo "Check http://tezos.gitlab.io/developer/testing.html#measuring-test-coverage"
        echo "for a list of known issues."
      fi
  # This is for gitlab to extract the coverage summary and display it
  # to the user as a badge.
  coverage: '/Coverage: \d+\/\d+ \(([^%]+%)\)/'
  artifacts:
    when: always
    paths:
      - _coverage_report/
    expire_in: 15 days
back to top