Try to fix CI again

This commit is contained in:
Tom Jack 2019-09-07 13:52:00 -07:00
parent 7e44886252
commit e0b5910627
14 changed files with 40 additions and 72 deletions

View File

@ -9,7 +9,7 @@ stages:
- test
.website_build: &website_build
stage: test # TODO DODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODO restore to build_and_deploy_website
stage: build_and_deploy_website
image: node:8
before_script:
- scripts/install_native_dependencies.sh
@ -18,18 +18,12 @@ stages:
- eval $(opam config env)
- scripts/setup_switch.sh
- eval $(opam config env)
- scripts/debug_show_versions.sh || true
- scripts/setup_repos.sh
# install deps for internal documentation
- opam install -y odoc
# - vendors/opam-repository-tools/rewrite-local-opam-repository.sh
# - opam repository add localrepo "file://$PWD/vendors/ligo-opam-repository-local-generated/"
- scripts/install_vendors_deps.sh
- opam install -y odoc
- scripts/build_ligo_local.sh
# - opam install -y --build-test --deps-only ./src/
# - dune build -p ligo
# TODO: also try instead from time to time:
#- (cd ./src/; dune build -p ligo)
# build with odoc
- dune build @doc
@ -67,14 +61,10 @@ stages:
- scripts/install_native_dependencies.sh
- scripts/install_opam.sh # TODO: or scripts/install_build_environment.sh ?
- export PATH="/usr/local/bin${PATH:+:}${PATH:-}"
- echo "$PATH"; which ocaml || true
- eval $(opam config env)
- echo "$PATH"; which ocaml || true
- scripts/setup_switch.sh
- echo "$PATH"; which ocaml || true
- eval $(opam config env)
- echo "$PATH"; which ocaml || true
- scripts/debug_show_versions.sh || true
- scripts/setup_repos.sh
local-dune-job:
<<: *before_script
@ -115,7 +105,7 @@ remote-repo-job:
# Run a docker build without publishing to the registry
build-current-docker-image:
stage: test # TODO DODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODO restore to build_docker
stage: build_docker
<<: *docker
<<: *docker_build
except:
@ -125,7 +115,7 @@ build-current-docker-image:
# When a MR/PR is merged to dev
# take the previous build and publish it to Docker Hub
build-and-publish-latest-docker-image:
stage: test # TODO DODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODODO restore to build_and_deploy_docker
stage: build_and_deploy_docker
<<: *docker
<<: *docker_build
after_script:
@ -133,9 +123,6 @@ build-and-publish-latest-docker-image:
- docker push $LIGO_REGISTRY_IMAGE:next
only:
- dev
- refactor/new-tezos-deps-ci
- refactor/new-tezos-deps-cicliexe
# Pages are deployed from both master & dev, be careful not to override 'next'
# in case something gets merged into 'dev' while releasing.
@ -144,5 +131,3 @@ pages:
only:
- master
- dev
- refactor/new-tezos-deps-ci
- refactor/new-tezos-deps-cicliexe

View File

@ -1,6 +1,5 @@
# We could use one of the nomadiclab's docker images as a base instead
# We're using 4.06 instead of 4.06.1, if this causes problems build a custom 4.06.1 image instead
FROM ocaml/opam2:4.06
# At the moment, this really means 4.07.1
FROM ocaml/opam2:4.07
USER root
@ -23,18 +22,14 @@ RUN sh scripts/install_native_dependencies.sh
# TODO: or scripts/install_build_environment.sh ?
RUN sh scripts/install_opam.sh
# Creat opam switch
RUN sh scripts/setup_switch.sh
# Add tezos repository
RUN sh scripts/setup_repos.sh
RUN opam update
# Install ligo
RUN sh scripts/install_vendors_deps.sh
RUN sh -c pwd
RUN sh scripts/build_ligo_local.sh
RUN sh -c pwd
RUN ls -l
RUN sh -c 'ls -l /ligo/_build/default/src/bin/cli.exe || true'
RUN opam install -y ./src
# Use the ligo binary as a default command
ENTRYPOINT [ "/ligo/_build/default/src/bin/cli.exe" ]
ENTRYPOINT [ "/home/opam/.opam/4.07/bin/ligo" ]

View File

@ -2,7 +2,7 @@
set -e
eval $(opam config env)
dune build src # TODO: make it work with -p ligo
dune build -p ligo
# TODO: also try instead from time to time:
#- (cd ./src/; dune build -p ligo)

View File

@ -1,8 +0,0 @@
#!/bin/sh
set -e
echo "$PATH"
opam --version
printf '' | ocaml
opam switch

View File

@ -1,5 +0,0 @@
#!/bin/sh
set -e
cd src
opam install . --yes

View File

@ -2,11 +2,5 @@
set -e
# Install local dependencies
opam install -y ./vendors/ligo-utils/simple-utils
opam install -y ./vendors/ligo-utils/tezos-protocol-alpha
opam install -y ./vendors/ligo-utils/tezos-protocol-alpha-parameters
opam install -y ./vendors/ligo-utils/memory-proto-alpha
opam install -y ./vendors/ligo-utils/tezos-utils/michelson-parser
opam install -y ./vendors/ligo-utils/tezos-utils
opam install -y ./vendors/ligo-utils/proto-alpha-utils
opam install -y getopt ppx_deriving menhir
opam install -y --deps-only $(find src vendors -name \*.opam)
opam install -y $(find vendors -name \*.opam)

View File

@ -2,6 +2,7 @@
set -e
"$(dirname "$0")"/setup_switch.sh
"$(dirname "$0")"/setup_repos.sh
opam install -y ocp-indent tuareg merlin alcotest-lwt crowbar
opam -y user-setup install

6
scripts/setup_repos.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
set -x
eval $(opam config env)
opam repo add tezos-opam-repository https://gitlab.com/nomadic-labs/tezos-opam-repository.git

View File

@ -4,12 +4,3 @@ set -x
printf '' | opam switch create . 4.07.1 # toto ocaml-base-compiler.4.06.1
eval $(opam config env)
# Add Tezos opam repository
opam repo add tezos-opam-repository https://gitlab.com/nomadic-labs/tezos-opam-repository.git
# TODO: move this to install_vendor_deps.sh
# Pin the versions of some dependencies
opam pin -y zarith 1.7
opam pin -y ipaddr 3.1.0
opam pin -y macaddr 3.1.0

View File

@ -1,2 +1,2 @@
(lang dune 1.6)
(lang dune 1.11)
(using menhir 2.0)

View File

@ -28,7 +28,7 @@
(targets parser_generated.mly)
(deps partial_parser.mly pre_parser.mly)
(action (system "cat pre_parser.mly partial_parser.mly > parser_generated.mly"))
(mode promote-until-clean)
(mode (promote (until-clean) (only *)))
)
(rule
@ -43,7 +43,7 @@
(targets ast_generated.ml)
(deps generator.exe)
(action (system "./generator.exe ast > ast_generated.ml"))
(mode promote-until-clean)
(mode (promote (until-clean) (only *)))
)
;; Generating Generator
@ -57,4 +57,10 @@
lex
)
(modules generator)
(preprocess
(pps
ppx_let
ppx_deriving.std
)
)
)

View File

@ -27,16 +27,16 @@
; (targets Parser.exe)
; (deps ParserMain.exe)
; (action (copy ParserMain.exe Parser.exe))
; (mode promote-until-clean))
; (mode (promote (until-clean) (only *))))
;(rule
; (targets Lexer.exe)
; (deps LexerMain.exe)
; (action (copy LexerMain.exe Lexer.exe))
; (mode promote-until-clean))
; (mode (promote (until-clean) (only *))))
(rule
(targets Version.ml)
(action
(progn (run "sh" "-c" "printf 'let version = \"%s\"'\\\\n \"$(echo UNKNOWN)\" > Version.ml")))
(mode promote-until-clean))
(mode (promote (until-clean) (only *))))

View File

@ -25,4 +25,4 @@
(targets Version.ml)
(action
(progn (run "sh" "-c" "printf 'let version = \"%s\"'\\\\n \"$(echo UNKNOWN)\" > Version.ml")))
(mode promote-until-clean))
(mode (promote (until-clean) (only *))))

View File

@ -18,7 +18,9 @@ depends: [
"ezjsonm"
"hex"
"hidapi"
"ipaddr"
# opam does not handle tezos' constraints well (why?)
"ipaddr" { >= "3.1.0" & < "4.0.0" }
"macaddr" { >= "3.1.0" & < "4.0.0" }
"irmin"
"js_of_ocaml"
"lwt"
@ -31,7 +33,8 @@ depends: [
"stdio"
"uri"
"uutf"
"zarith"
# tezos does not constrain their required version
"zarith" {= "1.7"}
"ocplib-json-typed"
"ocplib-json-typed-bson"
"tezos-crypto"