From 6147348b88a70e4ed751445dc2b42522fed7ede6 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 2 Aug 2022 15:41:20 +0200 Subject: [PATCH] ci: ci-conan no longer uses conan-package-tools --- .github/workflows/ci-conan.yml | 72 +++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index 0c1ad283..33f1a1d7 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -41,14 +41,12 @@ jobs: - { name: "Windows MSVC 14.2", os: windows-2019, - compiler: - { type: VISUAL, version: 16, std: 20, cc: "cl", cxx: "cl" }, + compiler: { type: VISUAL, version: 16, cc: "", cxx: "", std: 20 }, } - { name: "Windows MSVC 14.3", os: windows-2022, - compiler: - { type: MSVC, version: 193, std: 23, cc: "cl", cxx: "cl" }, + compiler: { type: MSVC, version: 193, cc: "", cxx: "", std: 23 }, } - { name: "Ubuntu GCC-10", @@ -140,17 +138,26 @@ jobs: std: 20, }, } - # In case a Conan docker image will be needed to provide a specific configuration we can use a Docker image as follows - # - { - # name: "Ubuntu GCC 10.2.0", - # os: ubuntu-20.04, - # compiler: { type: GCC, version: 10, cc: "gcc-10", cxx: "g++-10" }, - # docker_image: conanio/gcc10 - # } build_type: ["Release", "Debug"] downcast_mode: ["on", "auto"] + + env: + CC: ${{ matrix.config.compiler.cc }} + CXX: ${{ matrix.config.compiler.cxx }} + steps: - uses: actions/checkout@v2 + - name: Cache Conan data + uses: actions/cache@v2 + env: + cache-name: cache-conan-data + with: + path: ~/.conan/data + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - uses: hendrikmuhs/ccache-action@v1 if: runner.os == 'Linux' with: @@ -199,20 +206,21 @@ jobs: uses: actions/setup-python@v2 with: python-version: "3.8" - - name: Install Conan Package Tools + - name: Install Conan + shell: bash run: | - pip install -U conan_package_tools + pip install -U conan - name: Configure Conan - # TODO Find a proper syntax to make the below work - # if: !matrix.config.docker_image shell: bash run: | conan config init + conan remote add upload https://mpusz.jfrog.io/artifactory/api/conan/conan-oss if [[ "${{ matrix.config.compiler.type }}" == "GCC" || "${{ matrix.config.compiler.type }}" == "CLANG" ]]; then conan profile update settings.compiler.libcxx=${{ matrix.config.lib }} default fi conan profile update settings.compiler.cppstd=${{ matrix.config.compiler.std }} default - conan profile update conf.tools.cmake.cmaketoolchain:generator=Ninja default + conan profile update settings.build_type=${{ matrix.build_type }} default + conan profile update conf.tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" default conan profile show default # - name: Add support for clang-13 to Conan's settings.yml # # TODO Remove when Conan will support clang-13 @@ -220,21 +228,21 @@ jobs: # shell: bash # run: | # sed -i -e 's/"8", "9", "10", "11", "12"]/"8", "9", "10", "11", "12", "13"]/' ~/.conan/settings.yml - - name: Run Conan Package Tools + - name: Set channel shell: bash - env: - CONAN_USERNAME: mpusz - CONAN_OPTIONS: mp-units:build_docs=False,mp-units:downcast_mode=${{ matrix.downcast_mode }} - CONAN_UPLOAD: https://mpusz.jfrog.io/artifactory/api/conan/conan-oss - CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_LOGIN_USERNAME }} - CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }} - CONAN_CMAKE_GENERATOR: Ninja - CONAN_BUILD_TYPES: ${{ matrix.build_type }} - CC: ${{ matrix.config.compiler.cc }} - CXX: ${{ matrix.config.compiler.cxx }} - CONAN_${{ matrix.config.compiler.type }}_VERSIONS: ${{ matrix.config.compiler.version }} run: | - if [ ! -z "${{ matrix.config.docker_image }}" ]; then - export CONAN_DOCKER_IMAGE=${{ matrix.config.docker_image }} - fi - python build.py + [[ `git tag --contains ${{ github.sha }}` =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && CHANNEL=stable || CHANNEL=testing + echo "CHANNEL=${CHANNEL}" >> ${GITHUB_ENV} + - name: Create Conan package + shell: bash + run: | + conan create . mpusz/testing -e mp-units:CONAN_RUN_TESTS=True -o mp-units:build_docs=False -o mp-units:downcast_mode=${{ matrix.downcast_mode }} -b mp-units outdated -u + - name: Upload mp-units Conan package + shell: bash + run: | + conan user ${{ secrets.CONAN_LOGIN_USERNAME }} -r https://mpusz.jfrog.io/artifactory/api/conan/conan-oss -p ${{ secrets.CONAN_PASSWORD }} + conan upload "mp-units*" --all -r https://mpusz.jfrog.io/artifactory/api/conan/conan-oss --confirm + - name: Remove mp-units package from Conan local cache + shell: bash + run: | + conan remove mp-units -f