From d3f37a7bc619771ec3b05b8bce29703c035752d4 Mon Sep 17 00:00:00 2001 From: "Lars T. Kyllingstad" Date: Tue, 17 Aug 2021 13:39:35 +0200 Subject: [PATCH 1/3] Clean up Conan CI build environment using Docker --- .github/workflows/ci-conan.yml | 61 ++++++++++++++++++---------------- conanfile.py | 13 ++++++-- 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index 35ebbe7d..351b8a9e 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -3,24 +3,13 @@ name: libcosim CI Conan # This workflow is triggered on pushes to the repository. on: [push, workflow_dispatch] -env: - CONAN_LOGIN_USERNAME_OSP: ${{ secrets.osp_artifactory_usr }} - CONAN_PASSWORD_OSP: ${{ secrets.osp_artifactory_pwd }} - CONAN_REVISIONS_ENABLED: 1 - CONAN_NON_INTERACTIVE: True - CONAN_USE_ALWAYS_SHORT_PATHS: True - jobs: conan-on-linux: name: Conan - runs-on: ${{ matrix.os }} - env: - CC: gcc-${{ matrix.compiler_version }} - CXX: g++-${{ matrix.compiler_version }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - os: [ubuntu-18.04] build_type: [Debug, Release] compiler_version: [7, 8, 9] compiler_libcxx: [libstdc++11] @@ -28,16 +17,27 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install prerequisites + - name: Generate Dockerfile run: | - sudo apt-get install -y --no-install-recommends \ - g++-8 - sudo pip3 install --upgrade setuptools pip - sudo pip3 install conan - - name: Configure Conan - run: conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force - - name: Conan create + mkdir /tmp/osp-builder-docker + cat <<'EOF' >/tmp/osp-builder-docker/Dockerfile + FROM conanio/gcc${{ matrix.compiler_version }} + ENV CONAN_LOGIN_USERNAME_OSP=${{ secrets.osp_artifactory_usr }} + ENV CONAN_PASSWORD_OSP=${{ secrets.osp_artifactory_pwd }} + ENV CONAN_REVISIONS_ENABLED=1 + ENV CONAN_NON_INTERACTIVE=True + ENV CONAN_USE_ALWAYS_SHORT_PATHS=True + ENV LIBCOSIM_RUN_TESTS_ON_CONAN_BUILD=True + COPY entrypoint.sh / + ENTRYPOINT /entrypoint.sh + EOF + - name: Generate entrypoint.sh run: | + cat <<'EOF' >/tmp/osp-builder-docker/entrypoint.sh + #!/bin/bash -v + set -eu + cd /mnt/source + conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force REFNAME="${GITHUB_REF#refs/*/}" VERSION="v$( Date: Wed, 18 Aug 2021 08:19:08 +0200 Subject: [PATCH 2/3] Run tests in Conan CI builds on Windows too --- .github/workflows/ci-conan.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index 351b8a9e..84d058b1 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -67,6 +67,7 @@ jobs: CONAN_NON_INTERACTIVE: True CONAN_USE_ALWAYS_SHORT_PATHS: True CONAN_USER_HOME_SHORT: C:\c + LIBCOSIM_RUN_TESTS_ON_CONAN_BUILD: True strategy: fail-fast: false matrix: From 1346dcc8fcb753a6ab7b0e64d2472a9487075b6c Mon Sep 17 00:00:00 2001 From: "Lars T. Kyllingstad" Date: Wed, 18 Aug 2021 08:40:58 +0200 Subject: [PATCH 3/3] Avoid "True" being intercepted as YAML bool --- .github/workflows/ci-conan.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index 84d058b1..fdbc3a31 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -64,10 +64,10 @@ jobs: CONAN_LOGIN_USERNAME_OSP: ${{ secrets.osp_artifactory_usr }} CONAN_PASSWORD_OSP: ${{ secrets.osp_artifactory_pwd }} CONAN_REVISIONS_ENABLED: 1 - CONAN_NON_INTERACTIVE: True - CONAN_USE_ALWAYS_SHORT_PATHS: True + CONAN_NON_INTERACTIVE: 1 + CONAN_USE_ALWAYS_SHORT_PATHS: 1 CONAN_USER_HOME_SHORT: C:\c - LIBCOSIM_RUN_TESTS_ON_CONAN_BUILD: True + LIBCOSIM_RUN_TESTS_ON_CONAN_BUILD: 1 strategy: fail-fast: false matrix: