Skip to content

Commit 9829f2b

Browse files
committed
ci: printing toolchain versions fixed to account for the conan-installed environment
1 parent e3ef773 commit 9829f2b

File tree

5 files changed

+73
-11
lines changed

5 files changed

+73
-11
lines changed

.github/workflows/ci-clang-tidy.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,17 @@ jobs:
141141
run: |
142142
conan profile detect --force
143143
conan profile show -pr default
144+
- name: Install Conan dependencies
145+
shell: bash
146+
run: |
147+
conan install . -b missing ${{ matrix.conan-settings }} \
148+
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
149+
-c user.mp-units.build:all=True -c user.mp-units.analyze:clang-tidy=True -c tools.build:skip_test=True \
150+
${{ matrix.conan-args }}
144151
- name: Print tool versions
145152
shell: bash
146153
run: |
154+
source build/generators/conanbuild.sh
147155
${CXX} --version
148156
clang-tidy-${{ matrix.toolchain.compiler.version }} --version
149157
cmake --version 2>&1 || true

.github/workflows/ci-conan.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,35 @@ jobs:
163163
run: |
164164
conan profile detect --force
165165
conan profile show -pr default
166+
- name: Install Conan dependencies
167+
if: matrix.toolchain.compiler.type != 'MSVC'
168+
shell: bash
169+
run: |
170+
conan install . -b missing ${{ matrix.conan-settings }} \
171+
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -c user.mp-units.build:all=True \
172+
${{ matrix.conan-args }}
173+
- name: Install Conan dependencies
174+
if: matrix.toolchain.compiler.type == 'MSVC'
175+
shell: bash
176+
run: |
177+
conan install . -b missing ${{ matrix.conan-settings }} \
178+
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -c user.mp-units.build:all=False \
179+
${{ matrix.conan-args }}
166180
- name: Print tool versions
181+
if: matrix.toolchain.compiler.type == 'MSVC'
182+
shell: cmd
183+
run: |
184+
call build\generators\conanbuild.bat
185+
%CXX% 2>&1 || ver > nul
186+
cmake --version 2>&1 || ver > nul
187+
ninja --version 2>&1 || ver > nul
188+
conan --version
189+
python3 --version
190+
- name: Print tool versions
191+
if: matrix.toolchain.compiler.type != 'MSVC'
167192
shell: bash
168193
run: |
194+
source build/generators/conanbuild.sh
169195
${CXX} --version 2>&1 || true
170196
cmake --version 2>&1 || true
171197
ninja --version 2>&1 || true

.github/workflows/ci-freestanding.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,17 @@ jobs:
156156
run: |
157157
conan profile detect --force
158158
conan profile show -pr default
159+
- name: Install Conan dependencies
160+
shell: bash
161+
run: |
162+
conan install . -b missing ${{ matrix.conan-settings }} \
163+
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
164+
-c user.mp-units.build:all=True \
165+
${{ matrix.conan-args }}
159166
- name: Print tool versions
160167
shell: bash
161168
run: |
169+
source build/generators/conanbuild.sh
162170
${CXX} --version
163171
cmake --version 2>&1 || true
164172
ninja --version 2>&1 || true

.github/workflows/ci-sonarqube-cloud.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,28 @@ jobs:
133133
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.cppstd=.*/compiler.cppstd=${{ matrix.std }}/' ~/.conan2/profiles/default
134134
sed -i.backup '/^\[settings\]$/,/^\[/ s/^build_type=.*/build_type=${{ matrix.build_type }}/' ~/.conan2/profiles/default
135135
conan profile show -pr default
136+
- name: Set 'std_format' and 'import_std' environment variables
137+
shell: bash
138+
run: |
139+
echo "std_format=$([ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
140+
echo "import_std=$([ "${{ matrix.std }}" -ge "23" ] && [ "${{ matrix.config.cxx_modules }}" == "True" ] && [ "${{ matrix.contracts }}" == "none" ] && [ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
141+
- name: Install Conan dependencies
142+
shell: bash
143+
run: |
144+
conan install . -b missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
145+
-c user.mp-units.build:all=True -c user.mp-units.analyze:clang-tidy=False -c tools.build:skip_test=False \
146+
'-o &:cxx_modules=${{ matrix.config.cxx_modules }}' -o '&:import_std=${{ env.import_std }}' -o '&:std_format=${{ env.std_format }}' -o '&:contracts=${{ matrix.contracts }}' ${{ matrix.config.conan-config }} \
147+
-c 'tools.build:cxxflags=["-coverage"]'
136148
- name: Print tool versions
137149
shell: bash
138150
run: |
151+
source build/generators/conanbuild.sh
139152
${CXX} --version
140153
cmake --version 2>&1 || true
141154
ninja --version 2>&1 || true
142155
conan --version
143156
gcovr --version
144157
python3 --version
145-
- name: Set 'std_format' and 'import_std' environment variables
146-
shell: bash
147-
run: |
148-
echo "std_format=$([ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
149-
echo "import_std=$([ "${{ matrix.std }}" -ge "23" ] && [ "${{ matrix.config.cxx_modules }}" == "True" ] && [ "${{ matrix.contracts }}" == "none" ] && [ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
150158
- name: Build with Conan
151159
shell: bash
152160
run: |

.github/workflows/ci-test-package-cmake.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,32 @@ jobs:
169169
conan remote add artifactory https://mpusz.jfrog.io/artifactory/api/conan/conan-oss
170170
echo 'tools.cmake.cmake_layout:build_folder_vars=["settings.compiler", "settings.compiler.version", "settings.compiler.cppstd"]' >> ~/.conan2/global.conf
171171
conan profile show -pr default
172+
- name: Install Conan dependencies
173+
shell: bash
174+
run: |
175+
conan install . -b missing ${{ matrix.conan-settings }} \
176+
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
177+
-c user.mp-units.build:all=False ${{ matrix.conan-args }}
172178
- name: Print tool versions
179+
if: matrix.toolchain.compiler.type == 'MSVC'
180+
shell: cmd
181+
run: |
182+
call build\${{ matrix.conan-build-folder }}\generators\conanbuild.bat
183+
%CXX% 2>&1 || ver > nul
184+
cmake --version 2>&1 || ver > nul
185+
ninja --version 2>&1 || ver > nul
186+
conan --version
187+
python3 --version
188+
- name: Print tool versions
189+
if: matrix.toolchain.compiler.type != 'MSVC'
173190
shell: bash
174191
run: |
192+
source build/${{ matrix.conan-build-folder }}/generators/conanbuild.sh
175193
${CXX} --version 2>&1 || true
176194
cmake --version 2>&1 || true
177195
ninja --version 2>&1 || true
178196
conan --version
179197
python3 --version
180-
- name: Install Conan dependencies
181-
shell: bash
182-
run: |
183-
conan install . -b missing ${{ matrix.conan-settings }} \
184-
-c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
185-
-c user.mp-units.build:all=False ${{ matrix.conan-args }}
186198
- name: Provide dependencies for the build
187199
shell: bash
188200
working-directory: src

0 commit comments

Comments
 (0)