Skip to content

Commit

Permalink
removed BUILDDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Dec 6, 2021
1 parent b4deabc commit 44937ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
shell: bash
name: GCC-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}}
runs-on: ubuntu-latest
env:
BUILDDIR: 'build_GCC-C++${{matrix.std}}-${{matrix.build_type}}-${{matrix.lib}}-${{matrix.extra}}'
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -52,74 +50,75 @@ jobs:
cmake -S googletest-release-1.11.0 -B build-googletest \
-DBUILD_SHARED_LIBS=${{matrix.shared}} \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_INSTALL_PREFIX=./gtest \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/gtest \
-G Ninja
cmake --build build-googletest --target install
- name: Setup Environment
if: matrix.build_type == 'Debug'
run: |
echo 'CXXFLAGS=--coverage' >> $GITHUB_ENV
echo 'GTest_ROOT=${{github.workspace}}/gtest' >> $GITHUB_ENV
- name: Configure
run: |
cmake -S . -B "${{env.BUILDDIR}}" \
cmake -S . -B build_${{matrix.build_type}} \
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_INSTALL_PREFIX:PATH=./gtest \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install \
-DWITH_CUSTOM_PREFIX=${{matrix.extra == 'custom-prefix'}} \
-G Ninja
- name: Build
run: |
cmake --build "${{env.BUILDDIR}}" \
cmake --build build_${{matrix.build_type}} \
--config ${{matrix.build_type}}
- name: Install
run: |
cmake --build "${{env.BUILDDIR}}" \
cmake --build build_${{matrix.build_type}} \
--config ${{matrix.build_type}} \
--target install
cmake "${{env.BUILDDIR}}" -G Ninja \
cmake build_${{matrix.build_type}} \
-DCMAKE_INSTALL_INCLUDEDIR=${{runner.workspace}}/foo/include \
-DCMAKE_INSTALL_LIBDIR=${{runner.workspace}}/foo/lib \
-DCMAKE_INSTALL_DATAROOTDIR=${{runner.workspace}}/foo/share
cmake --build "${{env.BUILDDIR}}" \
cmake --build build_${{matrix.build_type}} \
--config ${{matrix.build_type}} \
--target install
- name: Test CMake Package (relative GNUInstallDirs)
run: |
cmake -S src/package_config_unittest/working_config \
-B "${{env.BUILDDIR}}_package" \
-B build_${{matrix.build_type}}_package \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_PREFIX_PATH="./${BUILDDIR}/install" \
-DCMAKE_PREFIX_PATH=${{github.workspace}}/install \
-G Ninja
cmake --build "${{env.BUILDDIR}}_package" \
cmake --build build_${{matrix.build_type}}_package \
--config ${{matrix.build_type}}
- name: Test CMake Package (absolute GNUInstallDirs)
run: |
cmake -S src/package_config_unittest/working_config \
-B "${{env.BUILDDIR}}_package_foo" \
-B build_${{matrix.build_type}}_package_foo \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/foo \
-G Ninja
cmake --build "${{env.BUILDDIR}}_package_foo" \
cmake --build build_${{matrix.build_type}}_package_foo \
--config ${{matrix.build_type}}
- name: Test
run: |
ctest --test-dir "${{env.BUILDDIR}}" -j$(nproc) --output-on-failure
ctest --test-dir build_${{matrix.build_type}} -j$(nproc) --output-on-failure
- name: Generate Coverage
if: matrix.build_type == 'Debug'
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info \
'*/install/include/*' \
'${{github.workspace}}/gtest/*' \
'*/src/*_unittest.cc' \
'*/src/googletest.h' \
'*/src/mock-log.h' \
Expand All @@ -129,7 +128,7 @@ jobs:
for file in src/glog/*.h.in; do
name=$(basename ${file})
name_we=${name%.h.in}
sed -i "s|${{env.BUILDDIR}}/glog/${name_we}.h\$|${file}|g" coverage.info
sed -i "s|build_${{matrix.build_type}}/glog/${name_we}.h\$|${file}|g" coverage.info
done
lcov --list coverage.info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
for file in src/glog/*.h.in; do
name=$(basename ${file})
name_we=${name%.h.in}
sed -i "s|${{env.BUILDDIR}}/glog/${name_we}.h\$|${file}|g" coverage.info
sed -i "s|${{github.workspace}}/glog/${name_we}.h\$|${file}|g" coverage.info
done
lcov --list coverage.info
Expand Down

0 comments on commit 44937ae

Please sign in to comment.