From 2579140df46f66fa7ae3f0323ad96e16d4475587 Mon Sep 17 00:00:00 2001 From: Aleksey Loginov Date: Wed, 26 Oct 2022 22:59:22 +0300 Subject: [PATCH 1/7] Add sample with package --- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++++++ src/examples/basic/CMakeLists.txt | 2 +- src/examples/package/CMakeLists.txt | 8 ++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/examples/package/CMakeLists.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44a6a2fb1..604486109 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -243,3 +243,35 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./gen_docs destination_dir: docs + + use_rpp_as_package: + needs: [download_deps] + + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + + timeout-minutes: 20 + runs-on: ${{ matrix.os }} + name: Test RPP as package - ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Generate project + run: cmake -B build + + - name: Install (unix) + if: matrix.os != 'windows-latest' + run: sudo cmake --build build --target install --parallel 2 --config Release + + - name: Install (windows) + if: matrix.os == 'windows-latest' + run: cmake --build build --target install --parallel 2 --config Release + + - name: Build sample + run: | + cmake -B sample_build -S src/examples/package + cmake --build sample_build --parallel 2 --config Release diff --git a/src/examples/basic/CMakeLists.txt b/src/examples/basic/CMakeLists.txt index 86640860e..d094456bc 100644 --- a/src/examples/basic/CMakeLists.txt +++ b/src/examples/basic/CMakeLists.txt @@ -2,5 +2,5 @@ add_executable(basic_sample basic.cpp ) -target_link_libraries(basic_sample PRIVATE rpp) +target_link_libraries(basic_sample PRIVATE RPP::rpp) set_target_properties(basic_sample PROPERTIES FOLDER Examples) diff --git a/src/examples/package/CMakeLists.txt b/src/examples/package/CMakeLists.txt new file mode 100644 index 000000000..b0eab544f --- /dev/null +++ b/src/examples/package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES CXX) + +find_package(RPP REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../basic/basic.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE RPP::rpp) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) \ No newline at end of file From a3932f2d5f0d0eaf8bccdc48e970a07b1eeca23e Mon Sep 17 00:00:00 2001 From: Aleksey Loginov Date: Thu, 27 Oct 2022 00:09:05 +0300 Subject: [PATCH 2/7] Update ci.yml --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 604486109..bcd34ddbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -259,6 +259,12 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + + - name: Configure compiler (unix) + if: matrix.os != 'windows-latest' + run: | + export CC=gcc-10 + export CXX=g++-10 - name: Generate project run: cmake -B build From 63603a0350ebe296da79d1cacd98d5d1cd07e014 Mon Sep 17 00:00:00 2001 From: Aleksey Loginov Date: Thu, 27 Oct 2022 22:15:54 +0300 Subject: [PATCH 3/7] Update ci.yml --- .github/workflows/ci.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcd34ddbd..c26e7ee8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,9 @@ on: branches: - main -env: + + +: CATCH2_VERSION: v3.1.0 Catch2_DIR: ~/Catch2_BIN @@ -247,30 +249,32 @@ jobs: use_rpp_as_package: needs: [download_deps] + strategy: matrix: - os: [ubuntu-latest, windows-latest] + config: [{CC: gcc-10, CXX:g++-10, os: ubuntu-latest}, + {CC: "" , CXX: "", os: windows-latest}] timeout-minutes: 20 - runs-on: ${{ matrix.os }} - name: Test RPP as package - ${{ matrix.os }} + runs-on: ${{ matrix.config.os }} + name: Test RPP as package - ${{ matrix.config.os }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Configure compiler (unix) - if: matrix.os != 'windows-latest' - run: | - export CC=gcc-10 - export CXX=g++-10 - - name: Generate project + env: + CC: ${{ matrix.config.CC }} + CXX: ${{ matrix.config.CXX }} run: cmake -B build - name: Install (unix) if: matrix.os != 'windows-latest' + env: + CC: ${{ matrix.config.CC }} + CXX: ${{ matrix.config.CXX }} run: sudo cmake --build build --target install --parallel 2 --config Release - name: Install (windows) @@ -278,6 +282,9 @@ jobs: run: cmake --build build --target install --parallel 2 --config Release - name: Build sample + env: + CC: ${{ matrix.config.CC }} + CXX: ${{ matrix.config.CXX }} run: | cmake -B sample_build -S src/examples/package cmake --build sample_build --parallel 2 --config Release From 66d612d4103f407ab8042ab194122c0aa77f86dc Mon Sep 17 00:00:00 2001 From: Aleksey Loginov Date: Thu, 27 Oct 2022 22:21:16 +0300 Subject: [PATCH 4/7] Update ci.yml --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c26e7ee8f..3ab036109 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,7 @@ on: branches: - main - - -: +env: CATCH2_VERSION: v3.1.0 Catch2_DIR: ~/Catch2_BIN From 764e3418f5c34b439aa0a3035dc828f1847a668b Mon Sep 17 00:00:00 2001 From: Aleksey Loginov Date: Thu, 27 Oct 2022 22:24:06 +0300 Subject: [PATCH 5/7] Update ci.yml --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ab036109..747875965 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -250,8 +250,13 @@ jobs: strategy: matrix: - config: [{CC: gcc-10, CXX:g++-10, os: ubuntu-latest}, - {CC: "" , CXX: "", os: windows-latest}] + config: + - CC: gcc-10 + CXX: g++-10 + os: ubuntu-latest + - CC: + CXX: + os: windows-latest timeout-minutes: 20 runs-on: ${{ matrix.config.os }} From fa04a7cde329f7dff44e7d7b1cbb60bbd814e256 Mon Sep 17 00:00:00 2001 From: Aleksey Loginov Date: Thu, 27 Oct 2022 22:28:43 +0300 Subject: [PATCH 6/7] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 747875965..29a09d7d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -274,14 +274,14 @@ jobs: run: cmake -B build - name: Install (unix) - if: matrix.os != 'windows-latest' + if: matrix.config.os != 'windows-latest' env: CC: ${{ matrix.config.CC }} CXX: ${{ matrix.config.CXX }} run: sudo cmake --build build --target install --parallel 2 --config Release - name: Install (windows) - if: matrix.os == 'windows-latest' + if: matrix.config.os == 'windows-latest' run: cmake --build build --target install --parallel 2 --config Release - name: Build sample From 736bc4e9c4b2faea09ae0f5fca7a0226769ea7f0 Mon Sep 17 00:00:00 2001 From: Aleksey Loginov Date: Thu, 27 Oct 2022 23:25:14 +0300 Subject: [PATCH 7/7] Update ci.yml --- .github/workflows/ci.yml | 42 +++++++++------------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29a09d7d4..dce9f49e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -247,47 +247,23 @@ jobs: use_rpp_as_package: needs: [download_deps] - - strategy: - matrix: - config: - - CC: gcc-10 - CXX: g++-10 - os: ubuntu-latest - - CC: - CXX: - os: windows-latest - timeout-minutes: 20 - runs-on: ${{ matrix.config.os }} - name: Test RPP as package - ${{ matrix.config.os }} + runs-on: ubuntu-latest + name: Test RPP as package - ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Generate project - env: - CC: ${{ matrix.config.CC }} - CXX: ${{ matrix.config.CXX }} - run: cmake -B build - - - name: Install (unix) - if: matrix.config.os != 'windows-latest' - env: - CC: ${{ matrix.config.CC }} - CXX: ${{ matrix.config.CXX }} - run: sudo cmake --build build --target install --parallel 2 --config Release - - - name: Install (windows) - if: matrix.config.os == 'windows-latest' - run: cmake --build build --target install --parallel 2 --config Release - - - name: Build sample + - name: Install project and build env: - CC: ${{ matrix.config.CC }} - CXX: ${{ matrix.config.CXX }} + CC: gcc-10 + CXX: g++-10 run: | + cmake -B build + sudo cmake --build build --target install --parallel 2 --config Release + cmake -B sample_build -S src/examples/package cmake --build sample_build --parallel 2 --config Release +