From 245f85badaa7127b3d39b366f98d880252e4f0e5 Mon Sep 17 00:00:00 2001 From: Stevendeo Date: Tue, 20 Sep 2022 15:58:03 +0200 Subject: [PATCH] Fix CI (#518) * Updating docker build for fixing CI * Test * Test * Test * Test * All jobs * Fix style * Fix indent * Trying to delay depext installation * Trying without specifying depect * Test fix --- .github/workflows/build_docker.yml | 22 +++++++++++++--------- .github/workflows/build_macos.yml | 9 ++------- .github/workflows/linter.yml | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index 328ddee96d..8f61497f75 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -3,12 +3,7 @@ name: Build with ocp Docker container # The goal of this workflow is to test the installation of the project with opam # on a specific light docker container instead of using default GH-actions one. -on: - push: - branches: - - fix-ci - - next - - main +on: [push,pull_request] jobs: install_docker: @@ -20,16 +15,25 @@ jobs: # as a system compiler. This container also contains opam 2.1. container: image: ocamlpro/ocaml:4.10 + options: --user root steps: - # This line is needed to acces and use opam. We are unable to set the user - # to `ocaml` with the container parameters - - run: sudo chmod a+wx . # Checkout the code of the current branch - name: Checkout code uses: actions/checkout@v2 + # Switch to ocaml user + - run: su ocaml + + # This line is needed to acces and use opam. We are unable to set the user + # to `ocaml` with the container parameters + - run: sudo chmod a+wx . + + # This line is needed to allow the working directory to be used even + # the ocaml user do not have rights on it. + - run: git config --global --add safe.directory /__w/alt-ergo/alt-ergo + # Create a switch with the system compiler (no compilation needed). # And then, install external (no need for depext with opam 2.1) and libs deps. - run: opam switch create . ocaml-system --deps-only diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index 14cd4156e1..8cdf7c573e 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -3,12 +3,7 @@ name: Build MacOS # This workflow try to build and test Alt-Ergo on a MacOS system # If the build succed, an artifact with the alt-ergo binary is uploaded # It only runs on `next` or `main` branch -on: - push: - branches: - - fix-ci - - next - - main +on: [push,pull_request] env: OCAML_DEFAULT_VERSION: 4.10.0 @@ -63,7 +58,7 @@ jobs: # Install dependencies - name: Install deps - run: opam install ./*.opam --deps-only --with-test --depext + run: opam install ./*.opam --deps-only --with-test # Build and install with opam diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 516c8a6266..0d71b10e06 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,6 +1,6 @@ name: Linter -on: push +on: [push,pull_request] env: OCAML_DEFAULT_VERSION: 4.10.0