ci: Conan CI GitHub Action replaced with a new one

This commit is contained in:
Mateusz Pusz
2020-12-23 22:29:37 +01:00
parent bf3815a5ee
commit 31d00ea370
2 changed files with 51 additions and 113 deletions

View File

@@ -31,23 +31,64 @@ on:
- 'docs/**' - 'docs/**'
jobs: jobs:
conan: build:
name: ${{ matrix.compiler.name }} ${{ matrix.compiler.version }} name: ${{ matrix.config.name }} ${{ matrix.build_type }}
runs-on: ubuntu-20.04 runs-on: ${{ matrix.config.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
compiler: config:
- { name: "gcc", version: "10" } - {
name: "Windows MSVC 2019",
os: windows-latest,
compiler: { type: VISUAL, version: 16, cc: "cl", cxx: "cl" }
}
- {
name: "Ubuntu GCC 10.2",
os: ubuntu-latest,
compiler: { type: GCC, version: 10, cc: "gcc-10", cxx: "g++-10" }
}
build_type: [ "Release", "Debug" ]
steps: steps:
- uses: actions/checkout@v2 - 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 }}-
- name: Install Ninja
shell: bash
run: |
if [ $RUNNER_OS == 'Linux' ]; then
sudo apt install -y ninja-build
elif [ $RUNNER_OS == 'Windows' ]; then
choco install ninja
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: '3.8' python-version: '3.8'
- name: Install Conan - name: Install Conan Package Tools
run: | run: |
pip install -U conan_package_tools pip install -U conan_package_tools
- name: Set Conan default profile
shell: bash
run: |
conan profile new --detect default
if [ ${{ matrix.config.compiler.type }} == 'GCC' ]; then
conan profile update settings.compiler.libcxx=libstdc++11 default
elif [ ${{ matrix.config.compiler.type }} == 'CLANG' ]; then
conan profile update settings.compiler.libcxx=libc++ default
fi
- name: Run conan-package-tools - name: Run conan-package-tools
env: env:
CONAN_USERNAME: mpusz CONAN_USERNAME: mpusz
@@ -56,7 +97,9 @@ jobs:
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_LOGIN_USERNAME }} CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_LOGIN_USERNAME }}
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }} CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }}
CONAN_CMAKE_GENERATOR: Ninja CONAN_CMAKE_GENERATOR: Ninja
CONAN_DOCKER_IMAGE: conanio/${{ matrix.compiler.name }}${{ matrix.compiler.version }} 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: | run: |
export CONAN_`echo ${{ matrix.compiler.name }} | tr [:lower:] [:upper:]`_VERSIONS="${{ matrix.compiler.version }}"
python build.py python build.py

View File

@@ -1,105 +0,0 @@
# The MIT License (MIT)
#
# Copyright (c) 2018 Mateusz Pusz
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: New CI
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
jobs:
build:
name: ${{ matrix.config.name }} ${{ matrix.build_type }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows MSVC 2019",
os: windows-latest,
compiler: { type: VISUAL, version: 16, cc: "cl", cxx: "cl" }
}
- {
name: "Ubuntu GCC 10.2",
os: ubuntu-latest,
compiler: { type: GCC, version: 10, cc: "gcc-10", cxx: "g++-10" }
}
build_type: [ "Release", "Debug" ]
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 }}-
- name: Install Ninja
shell: bash
run: |
if [ $RUNNER_OS == 'Linux' ]; then
apt install -y ninja-build
elif [ $RUNNER_OS == 'Windows' ]; then
choco install ninja
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install Conan Package Tools
run: |
pip install -U conan_package_tools
- name: Set Conan default profile
shell: bash
run: |
conan profile new --detect default
if [ ${{ matrix.config.compiler.type }} == 'GCC' ]; then
conan profile update settings.compiler.libcxx=libstdc++11 default
elif [ ${{ matrix.config.compiler.type }} == 'CLANG' ]; then
conan profile update settings.compiler.libcxx=libc++ default
fi
- name: Run conan-package-tools
env:
CONAN_USERNAME: mpusz
CONAN_OPTIONS: mp-units:build_docs=False
CONAN_UPLOAD: https://api.bintray.com/conan/mpusz/conan-mpusz
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: |
python build.py