From cda8a52c762a654931f216149988b892a277061f Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Thu, 16 Mar 2023 09:36:12 +0000 Subject: [PATCH] ci: stop using docker containers The docker hub is no longer reliable, convert ci workflow to the new ways that avoid using containers Signed-off-by: Pau Ruiz Safont --- .github/workflows/lcm.yml | 28 +++++++++++++++++++++++----- tools/travis.sh | 30 ------------------------------ 2 files changed, 23 insertions(+), 35 deletions(-) delete mode 100755 tools/travis.sh diff --git a/.github/workflows/lcm.yml b/.github/workflows/lcm.yml index e901ead76..b054aa33c 100644 --- a/.github/workflows/lcm.yml +++ b/.github/workflows/lcm.yml @@ -13,14 +13,32 @@ jobs: build: runs-on: ubuntu-20.04 steps: + - name: Update apt cache + run: sudo apt-get update + - name: Checkout uses: actions/checkout@v3 - name: Check whether there are unlicensed packages run: tools/license-check.sh - - name: Build the whole xs-toolstack - run: bash tools/travis.sh - env: - OCAML_VERSION: 4.08 - OPAMWITHTEST: true + - name: Use ocaml + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: "4.08.1" + opam-repositories: | + xs-opam: "." + opam-disable-sandboxing: true + opam-pin: false + + - name: Build xs-toolstack, test its dependencies + # opam install may ignore installing depexts sometimes + # OPAMCOLOR is set to "always" by default and it breaks piping + run: | + OPAMERRLOGLEN=10000 OPAMCOLOR=NEVER opam list -s --required-by xs-toolstack | xargs opam depext -tu + OPAMERRLOGLEN=10000 OPAMCOLOR=NEVER opam list -s --required-by xs-toolstack | xargs opam install -t + + - name: Uninstall unversioned packages + # This should purge them from the cache, unversioned package have + # 'master' as its version + run: opam list | awk -F " " '$2 == "master" { print $1 }' | xargs opam uninstall diff --git a/tools/travis.sh b/tools/travis.sh deleted file mode 100755 index e5b6f5ee0..000000000 --- a/tools/travis.sh +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/bash -# This script attempts to install all upstream dependencies using OCaml -# in a Docker container. This must be run from the root of the xs-opam -# repository. -# - -set -e - -IMG='ocaml/opam:debian-10-ocaml-4.08' - -docker pull $IMG -if [ "${OPAMWITHTEST}" = "true" ]; then - # opam 2.x only tests packages listed on the cmdline, unlike opam 1.x - INSTALL="opam list ${RECURSIVE} -s --required-by xs-toolstack | xargs opam install -t" -else - INSTALL="opam install xs-toolstack" -fi - -docker run --rm -iv $PWD:/mnt $IMG <