Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/job_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def for_github(self):
# expose individual ConanOptions fields as top-level matrix properties
# (needed for YAML conditions and cache keys)
ret.update(features)
ret["conan-config"] = " ".join(f"-o '&:{k}={v}'" for k, v in features.items())
options = " ".join(f"-o '&:{k}={v}'" for k, v in features.items())
ret["config-summary-str"] = self.infostr(adjusted=False)
# Pre-build the -s flags so workflows and repro scripts can use them directly
# without sed-patching the auto-detected Conan profile.
Expand All @@ -141,6 +141,13 @@ def for_github(self):
ret["conan-build-folder"] = (
f"{_COMPILER_TYPE_MAP[self.toolchain.compiler.type]}-{self.toolchain.compiler.version}-{self.std}"
)
cc = self.toolchain.compiler.cc
cxx = self.toolchain.compiler.cxx
if cc and cxx:
conf = f'-c \'tools.build:compiler_executables={{"c": "{cc}", "cpp": "{cxx}"}}\''
ret["conan-args"] = f"{conf} {options}"
else:
ret["conan-args"] = options
return ret

def _formatters():
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
conan build . -b missing ${{ matrix.conan-settings }} \
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
-c user.mp-units.build:all=True -c user.mp-units.analyze:clang-tidy=True -c tools.build:skip_test=True \
${{ matrix.conan-config }} 2>&1 | tee /tmp/clang-tidy.log
${{ matrix.conan-args }} 2>&1 | tee /tmp/clang-tidy.log
exit ${PIPESTATUS[0]}
- name: Emit clang-tidy annotations
if: failure()
Expand Down Expand Up @@ -185,5 +185,5 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Local repro** (in the provided '.devcontainer' or GitHub CodeSpaces environment):" >> $GITHUB_STEP_SUMMARY
echo '```sh' >> $GITHUB_STEP_SUMMARY
echo "conan build . -b missing ${{ matrix.conan-settings }} -c user.mp-units.build:all=True -c user.mp-units.analyze:clang-tidy=True -c tools.build:skip_test=True ${{ matrix.conan-config }}" >> $GITHUB_STEP_SUMMARY
echo "conan build . -b missing ${{ matrix.conan-settings }} -c user.mp-units.build:all=True -c user.mp-units.analyze:clang-tidy=True -c tools.build:skip_test=True ${{ matrix.conan-args }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
6 changes: 3 additions & 3 deletions .github/workflows/ci-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ jobs:
conan create . --user mpusz --channel ${CHANNEL} --lockfile-out=package.lock \
-b mp-units/* -b missing ${{ matrix.conan-settings }} \
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -c user.mp-units.build:all=True \
${{ matrix.conan-config }}
${{ matrix.conan-args }}
- name: Create Conan package
if: matrix.toolchain.compiler.type == 'MSVC'
shell: bash
run: |
conan create . --user mpusz --channel ${CHANNEL} --lockfile-out=package.lock \
-b mp-units/* -b missing ${{ matrix.conan-settings }} \
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -c user.mp-units.build:all=False \
${{ matrix.conan-config }}
${{ matrix.conan-args }}
- name: Obtain package reference
id: get-package-ref
shell: bash
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
echo "**Local repro** (in the provided '.devcontainer' or GitHub CodeSpaces environment):" >> $GITHUB_STEP_SUMMARY
echo '```sh' >> $GITHUB_STEP_SUMMARY
[ "${{ matrix.toolchain.compiler.type }}" != "MSVC" ] && ALL="True" || ALL="False"
echo "conan create . -b mp-units/* -b missing ${{ matrix.conan-settings }} -c user.mp-units.build:all=${ALL} ${{ matrix.conan-config }}" >> $GITHUB_STEP_SUMMARY
echo "conan create . -b mp-units/* -b missing ${{ matrix.conan-settings }} -c user.mp-units.build:all=${ALL} ${{ matrix.conan-args }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

outputs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-freestanding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
conan build . -b missing ${{ matrix.conan-settings }} \
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
-c user.mp-units.build:all=True \
${{ matrix.conan-config }}
${{ matrix.conan-args }}
- name: Clean Conan cache before backup
shell: bash
run: |
Expand All @@ -178,5 +178,5 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Local repro** (in the provided '.devcontainer' or GitHub CodeSpaces environment):" >> $GITHUB_STEP_SUMMARY
echo '```sh' >> $GITHUB_STEP_SUMMARY
echo "conan build . -b missing ${{ matrix.conan-settings }} -c user.mp-units.build:all=True ${{ matrix.conan-config }}" >> $GITHUB_STEP_SUMMARY
echo "conan build . -b missing ${{ matrix.conan-settings }} -c user.mp-units.build:all=True ${{ matrix.conan-args }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
4 changes: 2 additions & 2 deletions .github/workflows/ci-test-package-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
run: |
conan install . -b missing ${{ matrix.conan-settings }} \
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
-c user.mp-units.build:all=False ${{ matrix.conan-config }}
-c user.mp-units.build:all=False ${{ matrix.conan-args }}
- name: Provide dependencies for the build
shell: bash
working-directory: src
Expand Down Expand Up @@ -290,7 +290,7 @@ jobs:
BUILD_TYPE_LOWER=$(echo "${{ matrix.build_type }}" | tr '[:upper:]' '[:lower:]')
echo '```sh' >> $GITHUB_STEP_SUMMARY
echo "echo 'tools.cmake.cmake_layout:build_folder_vars=[\"settings.compiler\", \"settings.compiler.version\", \"settings.compiler.cppstd\"]' >> ~/.conan2/global.conf" >> $GITHUB_STEP_SUMMARY
echo "conan install . -b missing ${{ matrix.conan-settings }} -c user.mp-units.build:all=False ${{ matrix.conan-config }}" >> $GITHUB_STEP_SUMMARY
echo "conan install . -b missing ${{ matrix.conan-settings }} -c user.mp-units.build:all=False ${{ matrix.conan-args }}" >> $GITHUB_STEP_SUMMARY
echo "echo '{\"version\":4,\"include\":[\"../CMakeUserPresets.json\"]}' > src/CMakeUserPresets.json" >> $GITHUB_STEP_SUMMARY
echo "echo '{\"version\":4,\"include\":[\"../CMakeUserPresets.json\"]}' > test_package/CMakeUserPresets.json" >> $GITHUB_STEP_SUMMARY
echo "(cd src && source ../build/${{ matrix.conan-build-folder }}/generators/conanbuild.sh && cmake --preset conan-${{ matrix.conan-build-folder }} -DCMAKE_INSTALL_PREFIX=../out && cmake --build --preset conan-${{ matrix.conan-build-folder }}-${BUILD_TYPE_LOWER} --target install)" >> $GITHUB_STEP_SUMMARY
Expand Down
Loading