forked from mpusz/mp-units
merge branch master
This commit is contained in:
@@ -26,17 +26,17 @@ on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Check
|
||||
run: |
|
||||
pre-commit run --all-files
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Check
|
||||
run: |
|
||||
pre-commit run --all-files
|
||||
|
||||
+128
-36
@@ -30,6 +30,9 @@ on:
|
||||
paths-ignore:
|
||||
- "docs/**"
|
||||
|
||||
env:
|
||||
CHANNEL: ${{ fromJSON('["testing", "stable"]')[github.ref_type == 'tag' && startsWith(github.ref_name, 'v')] }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.config.name }} ${{ matrix.build_type }} [downcast=${{ matrix.downcast_mode }}]
|
||||
@@ -42,15 +45,17 @@ jobs:
|
||||
name: "Windows MSVC 14.2",
|
||||
os: windows-2019,
|
||||
compiler: { type: VISUAL, version: 16, cc: "", cxx: "", std: 20 },
|
||||
conan-config: "-c user.build:skip_la=True",
|
||||
}
|
||||
- {
|
||||
name: "Windows MSVC 14.3",
|
||||
os: windows-2022,
|
||||
compiler: { type: MSVC, version: 193, cc: "", cxx: "", std: 23 },
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu GCC-10",
|
||||
os: ubuntu-20.04,
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: GCC,
|
||||
@@ -59,11 +64,11 @@ jobs:
|
||||
cxx: "g++-10",
|
||||
std: 20,
|
||||
},
|
||||
lib: "libstdc++11",
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu GCC-11",
|
||||
os: ubuntu-20.04,
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: GCC,
|
||||
@@ -72,7 +77,20 @@ jobs:
|
||||
cxx: "g++-11",
|
||||
std: 20,
|
||||
},
|
||||
lib: "libstdc++11",
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu GCC-12",
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: GCC,
|
||||
version: 12,
|
||||
cc: "gcc-12",
|
||||
cxx: "g++-12",
|
||||
std: 20,
|
||||
},
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-12 + libstdc++11",
|
||||
@@ -86,6 +104,7 @@ jobs:
|
||||
std: 20,
|
||||
},
|
||||
lib: "libstdc++11",
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-12 + libc++",
|
||||
@@ -99,10 +118,11 @@ jobs:
|
||||
std: 20,
|
||||
},
|
||||
lib: "libc++",
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-13 + libc++",
|
||||
os: ubuntu-20.04,
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: CLANG,
|
||||
@@ -112,10 +132,11 @@ jobs:
|
||||
std: 20,
|
||||
},
|
||||
lib: "libc++",
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-14 + libc++",
|
||||
os: ubuntu-20.04,
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: CLANG,
|
||||
@@ -125,6 +146,35 @@ jobs:
|
||||
std: 20,
|
||||
},
|
||||
lib: "libc++",
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-15 + libc++",
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: CLANG,
|
||||
version: 15,
|
||||
cc: "clang-15",
|
||||
cxx: "clang++-15",
|
||||
std: 20,
|
||||
},
|
||||
lib: "libc++",
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-16 + libc++",
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: CLANG,
|
||||
version: 16,
|
||||
cc: "clang-16",
|
||||
cxx: "clang++-16",
|
||||
std: 20,
|
||||
},
|
||||
lib: "libc++",
|
||||
conan-config: "",
|
||||
}
|
||||
- {
|
||||
name: "MacOS Apple Clang 13",
|
||||
@@ -137,6 +187,7 @@ jobs:
|
||||
cxx: "clang++",
|
||||
std: 20,
|
||||
},
|
||||
conan-config: "",
|
||||
}
|
||||
build_type: ["Release", "Debug"]
|
||||
downcast_mode: ["on", "auto"]
|
||||
@@ -146,25 +197,27 @@ jobs:
|
||||
CXX: ${{ matrix.config.compiler.cxx }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Cache Conan data
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-conan-data
|
||||
with:
|
||||
path: ~/.conan/data
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }}
|
||||
path: ~/.conan2/p
|
||||
key: build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}-${{ matrix.config.lib }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
- uses: hendrikmuhs/ccache-action@v1
|
||||
build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}-${{ matrix.config.lib }}
|
||||
build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}-
|
||||
build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-
|
||||
build-${{ matrix.config.os }}-${{ matrix.build_type }}-
|
||||
build-${{ matrix.config.os }}-
|
||||
- uses: hendrikmuhs/ccache-action@v1.2
|
||||
if: runner.os == 'Linux'
|
||||
with:
|
||||
key: ${{ matrix.config.os }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}-${{ matrix.config.lib }}-${{ matrix.build_type }}-${{ matrix.downcast_mode }}
|
||||
max-size: 50M
|
||||
- name: Install gcc-11
|
||||
if: matrix.config.compiler.type == 'GCC' && matrix.config.compiler.version == '11'
|
||||
- name: Install gcc-12
|
||||
if: matrix.config.compiler.type == 'GCC' && matrix.config.compiler.version == '12'
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt install -y g++-${{ matrix.config.compiler.version }}
|
||||
@@ -201,7 +254,7 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.8"
|
||||
- name: Install Conan
|
||||
@@ -211,37 +264,76 @@ jobs:
|
||||
- name: Configure Conan
|
||||
shell: bash
|
||||
run: |
|
||||
conan config init
|
||||
conan remote add artifactory 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
|
||||
conan profile detect --force
|
||||
if [[ "${{ matrix.config.compiler.type }}" == "CLANG" ]]; then
|
||||
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.libcxx=.*/compiler.libcxx=${{ matrix.config.lib }}/' ~/.conan2/profiles/default
|
||||
fi
|
||||
conan profile update settings.compiler.cppstd=${{ matrix.config.compiler.std }} 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
|
||||
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.cppstd=.*/compiler.cppstd=${{ matrix.config.compiler.std }}/' ~/.conan2/profiles/default
|
||||
sed -i.backup '/^\[settings\]$/,/^\[/ s/^build_type=.*/build_type=${{ matrix.build_type }}/' ~/.conan2/profiles/default
|
||||
conan profile show -pr default
|
||||
# - name: Add support for clang-13 to Conan's settings.yml
|
||||
# # TODO Remove when Conan will support clang-13
|
||||
# if: matrix.config.compiler.type == 'CLANG'
|
||||
# shell: bash
|
||||
# run: |
|
||||
# sed -i -e 's/"8", "9", "10", "11", "12"]/"8", "9", "10", "11", "12", "13"]/' ~/.conan/settings.yml
|
||||
- name: Set channel
|
||||
shell: bash
|
||||
run: |
|
||||
[[ `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 -o mp-units:downcast_mode=${{ matrix.downcast_mode }} -c user.build:all=True -c user.build:skip_docs=True -b mp-units -b outdated -u
|
||||
- name: Upload mp-units Conan package
|
||||
conan create . --user mpusz --channel ${CHANNEL} --lockfile-out=package.lock \
|
||||
-b mp-units/* -b missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
|
||||
-o downcast_mode=${{ matrix.downcast_mode }} -c user.build:all=True -c user.build:skip_docs=True ${{ matrix.config.conan-config }}
|
||||
- name: Obtain package reference
|
||||
id: get-package-ref
|
||||
shell: bash
|
||||
run: |
|
||||
echo "PACKAGE_REF=`egrep -o mp-units[^%]+ package.lock`" >> ${GITHUB_OUTPUT}
|
||||
- name: Upload mp-units Conan package to Conan CI repository
|
||||
if: github.ref == 'refs/heads/master' || env.CHANNEL == 'stable'
|
||||
shell: bash
|
||||
run: |
|
||||
conan user ${{ secrets.CONAN_LOGIN_USERNAME }} -r artifactory -p ${{ secrets.CONAN_PASSWORD }}
|
||||
conan upload "mp-units*" --all -r artifactory --confirm
|
||||
- name: Remove mp-units package from Conan local cache
|
||||
conan remote add conan-mpusz-ci https://mpusz.jfrog.io/artifactory/api/conan/conan-ci
|
||||
conan remote login conan-mpusz-ci ${{ secrets.CONAN_LOGIN_USERNAME }} -p ${{ secrets.CONAN_CI_PASSWORD }}
|
||||
conan upload ${{ steps.get-package-ref.outputs.package_ref }} -r conan-mpusz-ci --confirm
|
||||
- name: Clean Conan cache before backup
|
||||
shell: bash
|
||||
run: |
|
||||
conan remove mp-units -c
|
||||
conan remove mp-units --confirm
|
||||
conan remove *#!latest --confirm
|
||||
conan remove *:*#!latest --confirm
|
||||
conan cache clean "*" -s -b -d
|
||||
outputs:
|
||||
package_ref: ${{ steps.get-package-ref.outputs.PACKAGE_REF }}
|
||||
|
||||
promote_package:
|
||||
if: github.ref == 'refs/heads/master' || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v'))
|
||||
needs: build
|
||||
name: Promote Conan package
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.8"
|
||||
- name: Install Conan
|
||||
shell: bash
|
||||
run: |
|
||||
pip install -U conan
|
||||
- name: Configure Conan
|
||||
shell: bash
|
||||
run: |
|
||||
conan remote add conan-mpusz-ci https://mpusz.jfrog.io/artifactory/api/conan/conan-ci
|
||||
conan remote add conan-mpusz-oss https://mpusz.jfrog.io/artifactory/api/conan/conan-oss
|
||||
- name: Promote mp-units Conan package
|
||||
shell: bash
|
||||
run: |
|
||||
conan remote login conan-mpusz-ci ${{ secrets.CONAN_LOGIN_USERNAME }} -p ${{ secrets.CONAN_CI_PASSWORD }}
|
||||
conan remote login conan-mpusz-oss ${{ secrets.CONAN_LOGIN_USERNAME }} -p ${{ secrets.CONAN_PASSWORD }}
|
||||
conan download ${{ needs.build.outputs.package_ref }} -r conan-mpusz-ci
|
||||
conan upload ${{ needs.build.outputs.package_ref }} -r conan-mpusz-oss --confirm
|
||||
- name: Do housekeeping on conan-mpusz-oss
|
||||
shell: bash
|
||||
run: |
|
||||
conan remove mp-units/*#!latest --confirm -r conan-mpusz-oss
|
||||
conan remove mp-units/*:*#!latest --confirm -r conan-mpusz-oss
|
||||
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu GCC-10",
|
||||
os: ubuntu-20.04,
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: GCC,
|
||||
@@ -63,11 +63,10 @@ jobs:
|
||||
cxx: "g++-10",
|
||||
std: 20,
|
||||
},
|
||||
lib: "libstdc++11",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu GCC-11",
|
||||
os: ubuntu-20.04,
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: GCC,
|
||||
@@ -76,7 +75,18 @@ jobs:
|
||||
cxx: "g++-11",
|
||||
std: 20,
|
||||
},
|
||||
lib: "libstdc++11",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu GCC-12",
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: GCC,
|
||||
version: 12,
|
||||
cc: "gcc-12",
|
||||
cxx: "g++-12",
|
||||
std: 20,
|
||||
},
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-12 + libstdc++11",
|
||||
@@ -106,7 +116,7 @@ jobs:
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-13 + libc++",
|
||||
os: ubuntu-20.04,
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: CLANG,
|
||||
@@ -119,7 +129,7 @@ jobs:
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-14 + libc++",
|
||||
os: ubuntu-20.04,
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: CLANG,
|
||||
@@ -130,6 +140,32 @@ jobs:
|
||||
},
|
||||
lib: "libc++",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-15 + libc++",
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: CLANG,
|
||||
version: 15,
|
||||
cc: "clang-15",
|
||||
cxx: "clang++-15",
|
||||
std: 20,
|
||||
},
|
||||
lib: "libc++",
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Clang-16 + libc++",
|
||||
os: ubuntu-22.04,
|
||||
compiler:
|
||||
{
|
||||
type: CLANG,
|
||||
version: 16,
|
||||
cc: "clang-16",
|
||||
cxx: "clang++-16",
|
||||
std: 20,
|
||||
},
|
||||
lib: "libc++",
|
||||
}
|
||||
- {
|
||||
name: "MacOS Apple Clang 13",
|
||||
os: macos-11,
|
||||
@@ -154,18 +190,20 @@ jobs:
|
||||
uses: ASzc/change-string-case-action@v2
|
||||
with:
|
||||
string: ${{ matrix.build_type }}
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Cache Conan data
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-conan-data
|
||||
with:
|
||||
path: ~/.conan/data
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }}
|
||||
path: ~/.conan2/p
|
||||
key: build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}-${{ matrix.config.lib }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}-${{ matrix.config.lib }}
|
||||
build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-${{ matrix.config.compiler.version }}-
|
||||
build-${{ matrix.config.os }}-${{ matrix.build_type }}-${{ matrix.config.compiler.type }}-
|
||||
build-${{ matrix.config.os }}-${{ matrix.build_type }}-
|
||||
build-${{ matrix.config.os }}-
|
||||
- name: Install gcc-11
|
||||
if: matrix.config.compiler.type == 'GCC' && matrix.config.compiler.version == '11'
|
||||
shell: bash
|
||||
@@ -204,7 +242,7 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.8"
|
||||
- name: Install Conan
|
||||
@@ -214,15 +252,14 @@ jobs:
|
||||
- name: Configure Conan
|
||||
shell: bash
|
||||
run: |
|
||||
conan config init
|
||||
conan profile detect --force
|
||||
conan remote add artifactory 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
|
||||
if [[ "${{ matrix.config.compiler.type }}" == "CLANG" ]]; then
|
||||
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.libcxx=.*/compiler.libcxx=${{ matrix.config.lib }}/' ~/.conan2/profiles/default
|
||||
fi
|
||||
conan profile update settings.compiler.cppstd=${{ matrix.config.compiler.std }} 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
|
||||
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.cppstd=.*/compiler.cppstd=${{ matrix.config.compiler.std }}/' ~/.conan2/profiles/default
|
||||
sed -i.backup '/^\[settings\]$/,/^\[/ s/^build_type=.*/build_type=${{ matrix.build_type }}/' ~/.conan2/profiles/default
|
||||
conan profile show -pr default
|
||||
# - name: Add support for clang-13 to Conan's settings.yml
|
||||
# # TODO Remove when Conan will support clang-13
|
||||
# if: matrix.config.compiler.type == 'CLANG'
|
||||
@@ -232,7 +269,7 @@ jobs:
|
||||
- name: Install Conan dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
conan install . -b outdated -u
|
||||
conan install . -b missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -c user.build:all=False
|
||||
mv CMakeUserPresets.json src
|
||||
- name: Configure mp-units CMake
|
||||
if: matrix.config.compiler.type == 'VISUAL' || matrix.config.compiler.type == 'MSVC'
|
||||
@@ -241,19 +278,19 @@ jobs:
|
||||
run: |
|
||||
cmake --version
|
||||
call ..\build\generators\conanvcvars.bat
|
||||
cmake --preset default -DCMAKE_INSTALL_PREFIX=../out
|
||||
cmake --preset conan-default -DCMAKE_INSTALL_PREFIX=../out
|
||||
- name: Configure mp-units CMake
|
||||
if: matrix.config.compiler.type != 'VISUAL' && matrix.config.compiler.type != 'MSVC'
|
||||
shell: bash
|
||||
working-directory: src
|
||||
run: |
|
||||
cmake --version
|
||||
cmake --preset default -DCMAKE_INSTALL_PREFIX=../out
|
||||
cmake --preset conan-default -DCMAKE_INSTALL_PREFIX=../out
|
||||
- name: Install mp-units
|
||||
shell: bash
|
||||
working-directory: src
|
||||
run: |
|
||||
cmake --build --preset ${{ steps.build_type.outputs.lowercase }} --target install
|
||||
cmake --build --preset conan-${{ steps.build_type.outputs.lowercase }} --target install
|
||||
- name: Provide dependencies for test_package
|
||||
shell: bash
|
||||
working-directory: test_package
|
||||
@@ -265,14 +302,14 @@ jobs:
|
||||
working-directory: test_package
|
||||
run: |
|
||||
call ..\build\generators\conanvcvars.bat
|
||||
cmake --preset default -Dmp-units_DIR=../build -Bbuild/local
|
||||
cmake --preset conan-default -Dmp-units_DIR=../build -Bbuild/local
|
||||
cmake --build build/local --config ${{ matrix.build_type }}
|
||||
- name: Build test_package CMake (local build)
|
||||
if: matrix.config.compiler.type != 'VISUAL' && matrix.config.compiler.type != 'MSVC'
|
||||
shell: bash
|
||||
working-directory: test_package
|
||||
run: |
|
||||
cmake --preset default -Dmp-units_DIR=../build -Bbuild/local
|
||||
cmake --preset conan-default -Dmp-units_DIR=../build -Bbuild/local
|
||||
cmake --build build/local --config ${{ matrix.build_type }}
|
||||
- name: Run test_package (local build)
|
||||
shell: bash
|
||||
@@ -285,14 +322,14 @@ jobs:
|
||||
working-directory: test_package
|
||||
run: |
|
||||
call ..\build\generators\conanvcvars.bat
|
||||
cmake --preset default -DCMAKE_INSTALL_PREFIX=../out -Bbuild/install
|
||||
cmake --preset conan-default -DCMAKE_INSTALL_PREFIX=../out -Bbuild/install
|
||||
cmake --build build/install --config ${{ matrix.build_type }}
|
||||
- name: Build test_package CMake (installation)
|
||||
if: matrix.config.compiler.type != 'VISUAL' && matrix.config.compiler.type != 'MSVC'
|
||||
shell: bash
|
||||
working-directory: test_package
|
||||
run: |
|
||||
cmake --preset default -DCMAKE_INSTALL_PREFIX=../out -Bbuild/install
|
||||
cmake --preset conan-default -DCMAKE_INSTALL_PREFIX=../out -Bbuild/install
|
||||
cmake --build build/install --config ${{ matrix.build_type }}
|
||||
- name: Run test_package (installation)
|
||||
shell: bash
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# This is needed for workflows running on
|
||||
# ubuntu-20.04 or later
|
||||
|
||||
@@ -25,22 +25,26 @@ on:
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CC: gcc-10
|
||||
CXX: g++-10
|
||||
|
||||
BUILD_TYPE: Debug
|
||||
COMPILER_TYPE: GCC
|
||||
COMPILER_VERSION: 10
|
||||
STDLIB: libstdc++11
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: ["cpp", "python"]
|
||||
os: ["ubuntu-latest"]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more...
|
||||
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
@@ -63,29 +67,29 @@ jobs:
|
||||
|
||||
- name: Cache Conan data
|
||||
if: matrix.language == 'cpp'
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-conan-data
|
||||
with:
|
||||
path: ~/.conan/data
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }}
|
||||
path: ~/.conan2/p
|
||||
key: build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-$COMPILER_VERSION-$STDLIB
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-$COMPILER_VERSION-
|
||||
build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-
|
||||
build-${{ matrix.os }}-$BUILD_TYPE-
|
||||
build-${{ matrix.os }}-
|
||||
- name: Set up Python
|
||||
if: matrix.language == 'cpp'
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.8"
|
||||
- name: Conan build
|
||||
if: matrix.language == 'cpp'
|
||||
run: |
|
||||
pip install -U conan
|
||||
conan config init
|
||||
conan remote add upload https://mpusz.jfrog.io/artifactory/api/conan/conan-oss
|
||||
conan profile detect --force
|
||||
conan remote add artifactory https://mpusz.jfrog.io/artifactory/api/conan/conan-oss
|
||||
mkdir _lgtm_build_dir && cd _lgtm_build_dir
|
||||
conan install .. -s compiler.cppstd=20 -s compiler.libcxx=libstdc++11 -c user.build:all=True -c user.build:skip_docs=True -b outdated -u
|
||||
conan build ..
|
||||
conan build .. -s compiler.cppstd=20 -s compiler.libcxx=$STDLIB -c user.build:all=True -c user.build:skip_docs=True -b missing
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
|
||||
@@ -35,35 +35,44 @@ on:
|
||||
- "docs/**"
|
||||
- "src/**"
|
||||
- "example/**"
|
||||
|
||||
env:
|
||||
CC: gcc-10
|
||||
CXX: g++-10
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CONAN_CMAKE_GENERATOR: Ninja
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
name: Generate documentation
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CC: gcc-10
|
||||
CXX: g++-10
|
||||
CMAKE_GENERATOR: Ninja
|
||||
CONAN_CMAKE_GENERATOR: Ninja
|
||||
OS: ubuntu-22.04
|
||||
BUILD_TYPE: Debug
|
||||
COMPILER_TYPE: GCC
|
||||
COMPILER_VERSION: 10
|
||||
STDLIB: libstdc++11
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ["ubuntu-latest"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Cache Conan data
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-conan-data
|
||||
with:
|
||||
path: ~/.conan/data
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/metadata.json') }}
|
||||
path: ~/.conan2/p
|
||||
key: build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-$COMPILER_VERSION-$STDLIB-docs
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-$COMPILER_VERSION-$STDLIB
|
||||
build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-$COMPILER_VERSION-
|
||||
build-${{ matrix.os }}-$BUILD_TYPE-$COMPILER_TYPE-
|
||||
build-${{ matrix.os }}-$BUILD_TYPE-
|
||||
build-${{ matrix.os }}-
|
||||
- name: Install Ninja
|
||||
run: |
|
||||
sudo apt install -y ninja-build
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.8"
|
||||
- name: Install Python dependencies
|
||||
@@ -74,17 +83,17 @@ jobs:
|
||||
pip install -U conan
|
||||
- name: Configure Conan
|
||||
run: |
|
||||
conan config init
|
||||
conan remote add -i 0 upload https://mpusz.jfrog.io/artifactory/api/conan/conan-oss
|
||||
conan profile detect --force
|
||||
conan remote add artifactory https://mpusz.jfrog.io/artifactory/api/conan/conan-oss
|
||||
- name: Install Conan dependencies
|
||||
run: |
|
||||
conan install . -s compiler.cppstd=20 -s compiler.libcxx=libstdc++11 -c user.build:all=True -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -b outdated -u
|
||||
conan install . -s compiler.cppstd=20 -s compiler.libcxx=$STDLIB -c user.build:all=True -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -b missing
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
cmake --preset default
|
||||
cmake --preset conan-default
|
||||
- name: Generate documentation
|
||||
run: |
|
||||
cmake --build --preset release --target documentation
|
||||
cmake --build --preset conan-release --target documentation
|
||||
- name: Deploy documentation
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
|
||||
Reference in New Issue
Block a user