From 2f2d9d528f14cc8c95531cc763fe935c29ecac4b Mon Sep 17 00:00:00 2001 From: bugdea1er Date: Tue, 30 Apr 2024 23:32:52 +0300 Subject: [PATCH] Tidy up CI test --- .github/workflows/Tests.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 860c926..847e4f0 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -5,6 +5,7 @@ on: env: build_dir: ${{ github.workspace }}/build + install_test_dir: ${{ github.workspace }}/install-test jobs: test: @@ -37,32 +38,29 @@ jobs: run: ctest --build-config working-directory: ${{ env.build_dir }} - - name: Run install + - name: Run installation run: sudo cmake --install ${{ env.build_dir }} - - name: Prepare install test directory - run: mkdir -p cmake-test - - - name: Run install test + - name: Prepare installation test directory + run: mkdir -p ${{ env.install_test_dir }} + + - name: Test installation run: | cat < main.cpp - #include #include - int main() - { - auto tmpfile = tmp::file("tmp.test"); - std::cout << tmpfile.release().native(); - return 0; + #include + int main() { + std::cout << tmp::file().release().native(); } EOS cat < CMakeLists.txt cmake_minimum_required(VERSION 3.12) - project(cmake-test LANGUAGES CXX) + project(install-test LANGUAGES CXX) find_package(tmp REQUIRED) - add_executable(cmake-test main.cpp) - target_link_libraries(cmake-test tmp::tmp) + add_executable(install-test main.cpp) + target_link_libraries(install-test tmp::tmp) EOS cmake -B . cmake --build . test -f $(./cmake-test) - working-directory: ${{ github.workspace }}/cmake-test + working-directory: ${{ env.install_test_dir }}