From eabccebd72508533b2b296b2b2f1cb0953ff1c16 Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Sun, 17 Nov 2024 15:03:43 +0300 Subject: [PATCH 01/15] Add installation rules and update .gitignore for build files --- .gitignore | 3 +++ CMakeLists.txt | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.gitignore b/.gitignore index b6bde0b..c2a88cb 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,6 @@ *.exe *.out *.app + +# Build files +build/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index e366cc5..f6e0eff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,3 +53,29 @@ ENDIF() IF(ENABLE_RVSTD_XT) ADD_SUBDIRECTORY(xt) ENDIF() + +# Install + +INCLUDE(GNUInstallDirs) + +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +INSTALL( + TARGETS rvstd + EXPORT rvstd-config + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +EXPORT( + TARGETS rvstd + NAMESPACE rvstd:: + FILE "${CMAKE_CURRENT_BINARY_DIR}/rvstd-config.cmake" +) + +INSTALL( + EXPORT rvstd-config + DESTINATION "${CMAKE_INSTALL_DATADIR}/rvstd/cmake" + NAMESPACE rvstd::) From 49781e7a036b976e0b82f2226bf87da3638e722b Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Sun, 17 Nov 2024 15:28:16 +0300 Subject: [PATCH 02/15] added a newline --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6e0eff..d134c96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,4 +78,5 @@ EXPORT( INSTALL( EXPORT rvstd-config DESTINATION "${CMAKE_INSTALL_DATADIR}/rvstd/cmake" - NAMESPACE rvstd::) + NAMESPACE rvstd:: +) From e6434c9e44886b2aa2f1f02e5894a97d8ef62916 Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Fri, 29 Nov 2024 00:54:54 +0300 Subject: [PATCH 03/15] Add GitHub Actions workflow for installation verification --- .github/workflows/release.yml | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..604b614 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +name: Check_installation + +on: + push: + branches: + - main + paths: + - src/** + - include/** + - CMakeLists.txt + pull_request: + paths: + - src/** + - include/** + - CMakeLists.txt + workflow_dispatch: + +jobs: + bloaty-job: + runs-on: ubuntu-latest + container: + image: ghcr.io/bounverif/rvstd:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github_token }} + + steps: + - name: Check out the repository + uses: actions/checkout@v4 + + - name: Configure and build this project + uses: threeal/cmake-action@latest + with: + build-dir: build + args: -DCMAKE_BUILD_TYPE=RELEASE + + - name: Install the library + run: cmake --install build --prefix /usr/local + + - name: Verify installation + run: | + if [ -f /usr/local/lib/librvstd.a ]; then + echo "librvstd.a is installed." + else + echo "librvstd.a is not installed." + exit 1 + fi + + - name: Check if the rvstd file has been generated + run: | + if [ -f /usr/local/include/rvstd ]; then + echo "rvstd file is generated." + else + echo "rvstd file is not generated." + exit 1 + fi + \ No newline at end of file From d1e88bc2ad3f73c1538daae4971a327229d9d17b Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Fri, 29 Nov 2024 00:57:47 +0300 Subject: [PATCH 04/15] Rename job in release workflow and update CMake action version --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 604b614..911b778 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ on: workflow_dispatch: jobs: - bloaty-job: + verification-job: runs-on: ubuntu-latest container: image: ghcr.io/bounverif/rvstd:latest @@ -29,7 +29,7 @@ jobs: uses: actions/checkout@v4 - name: Configure and build this project - uses: threeal/cmake-action@latest + uses: threeal/cmake-action@v2.0.0 with: build-dir: build args: -DCMAKE_BUILD_TYPE=RELEASE From 6157ec80b411bbdef03c8d717555c3e1a165594f Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Fri, 29 Nov 2024 12:12:12 +0300 Subject: [PATCH 05/15] Update Docker image in release workflow to use new repository --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 911b778..5022a50 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: verification-job: runs-on: ubuntu-latest container: - image: ghcr.io/bounverif/rvstd:latest + image: ghcr.io/omerfaruk691/rvstd:latest credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} From 7fcda5bff8a24a62b2cb07e5d66ab4149105c8a4 Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 9 Dec 2024 22:38:29 +0300 Subject: [PATCH 06/15] Update Docker image in release workflow to use development version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5022a50..bee989d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: verification-job: runs-on: ubuntu-latest container: - image: ghcr.io/omerfaruk691/rvstd:latest + image: ghcr.io/bounverif/rvstd:latest-devel credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} From 2ed5969ed08f41fa124212e06313a55239be4eb6 Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 9 Dec 2024 22:43:15 +0300 Subject: [PATCH 07/15] Include release workflow file in pull request and push triggers --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bee989d..5bf8d55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,11 +8,13 @@ on: - src/** - include/** - CMakeLists.txt + - .github/workflows/release.yml pull_request: paths: - src/** - include/** - CMakeLists.txt + - .github/workflows/release.yml workflow_dispatch: jobs: From 84f067cd2f3144f0fb8d1ad274264af3d166def9 Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 9 Dec 2024 22:51:13 +0300 Subject: [PATCH 08/15] Add persist-credentials option to checkout step in release workflow --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5bf8d55..8fdfbe3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,8 @@ jobs: steps: - name: Check out the repository uses: actions/checkout@v4 - + with: + persist-credentials: false - name: Configure and build this project uses: threeal/cmake-action@v2.0.0 with: From 6f3da663f7d89fd96e24b302c1af887fd4046879 Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 9 Dec 2024 22:53:26 +0300 Subject: [PATCH 09/15] Add permission setup step in release workflow --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8fdfbe3..a081f80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,10 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false + + - name: Set up permissions + run: sudo chmod -R 777 /__w/_temp + - name: Configure and build this project uses: threeal/cmake-action@v2.0.0 with: From b389b5e2d545d9997148cc2c6acab4467ffdafed Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 9 Dec 2024 22:57:28 +0300 Subject: [PATCH 10/15] Add root user option to release workflow container --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a081f80..1114e08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: runs-on: ubuntu-latest container: image: ghcr.io/bounverif/rvstd:latest-devel + options: --user root credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} @@ -34,7 +35,7 @@ jobs: - name: Set up permissions run: sudo chmod -R 777 /__w/_temp - + - name: Configure and build this project uses: threeal/cmake-action@v2.0.0 with: From cbb9411a28f91f2e1da954ad61f5ed84f1a5b694 Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 9 Dec 2024 23:03:03 +0300 Subject: [PATCH 11/15] Fix check for rvstd generation to verify directory instead of file --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1114e08..1042e81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,12 +54,12 @@ jobs: exit 1 fi - - name: Check if the rvstd file has been generated + - name: Check if the rvstd directory has been generated run: | - if [ -f /usr/local/include/rvstd ]; then - echo "rvstd file is generated." + if [ -d /usr/local/include/rvstd ]; then + echo "rvstd directory is generated." else - echo "rvstd file is not generated." + echo "rvstd directory is not generated." exit 1 fi \ No newline at end of file From ea9971d1c4d2c61464cac83f4ab00a314f59d1c1 Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 9 Dec 2024 23:16:26 +0300 Subject: [PATCH 12/15] Reorganize CMakeLists.txt to enable testing and add debugging message --- CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fa1799..66192dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,15 +118,6 @@ install( NAMESPACE rvstd:: ) -# Enable testing if requested -if(ENABLE_TESTS) - enable_testing() - add_subdirectory(tests) -endif() - -# Debugging message -message(STATUS "Building rvstd version ${PROJECT_VERSION}") - IF(ENABLE_RVSTD_XT) ADD_SUBDIRECTORY(xt) @@ -157,4 +148,13 @@ INSTALL( EXPORT rvstd-config DESTINATION "${CMAKE_INSTALL_DATADIR}/rvstd/cmake" NAMESPACE rvstd:: -) \ No newline at end of file +) + +# Enable testing if requested +if(ENABLE_TESTS) + enable_testing() + add_subdirectory(tests) +endif() + +# Debugging message +message(STATUS "Building rvstd version ${PROJECT_VERSION}") \ No newline at end of file From f48542904841c7acde6a344067d22f6f4b4ac696 Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 23 Dec 2024 08:42:25 +0300 Subject: [PATCH 13/15] Update installation commands in release workflow and clean up CMakeLists.txt --- .github/workflows/release.yml | 5 ++++- CMakeLists.txt | 32 -------------------------------- 2 files changed, 4 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1042e81..207f94f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,10 @@ jobs: args: -DCMAKE_BUILD_TYPE=RELEASE - name: Install the library - run: cmake --install build --prefix /usr/local + run: cmake --build . --target install --prefix /usr/local + + - name: Install the library as shared + run: cmake --build . --target rvstd-shared --target install --prefix /usr/local - name: Verify installation run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 66192dc..30ad8ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,38 +118,6 @@ install( NAMESPACE rvstd:: ) - -IF(ENABLE_RVSTD_XT) - ADD_SUBDIRECTORY(xt) -ENDIF() - -# Install - -INCLUDE(GNUInstallDirs) - -INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - -INSTALL( - TARGETS rvstd - EXPORT rvstd-config - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) - -EXPORT( - TARGETS rvstd - NAMESPACE rvstd:: - FILE "${CMAKE_CURRENT_BINARY_DIR}/rvstd-config.cmake" -) - -INSTALL( - EXPORT rvstd-config - DESTINATION "${CMAKE_INSTALL_DATADIR}/rvstd/cmake" - NAMESPACE rvstd:: -) - # Enable testing if requested if(ENABLE_TESTS) enable_testing() From 87f86482e5a821797a2b6e1f13b32e8cf8f1017c Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 23 Dec 2024 08:59:15 +0300 Subject: [PATCH 14/15] Simplify library installation step in release workflow --- .github/workflows/release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 207f94f..1042e81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,10 +43,7 @@ jobs: args: -DCMAKE_BUILD_TYPE=RELEASE - name: Install the library - run: cmake --build . --target install --prefix /usr/local - - - name: Install the library as shared - run: cmake --build . --target rvstd-shared --target install --prefix /usr/local + run: cmake --install build --prefix /usr/local - name: Verify installation run: | From c10e02bb5d25fe1ee465ce497d9213a8a85f818a Mon Sep 17 00:00:00 2001 From: omerfaruk Date: Mon, 23 Dec 2024 09:18:28 +0300 Subject: [PATCH 15/15] Add check for librvstd.so installation in release workflow --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1042e81..9166ba2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,6 +53,12 @@ jobs: echo "librvstd.a is not installed." exit 1 fi + if [ -f /usr/local/lib/librvstd.so ]; then + echo "librvstd.so is installed." + else + echo "librvstd.so is not installed." + exit 1 + fi - name: Check if the rvstd directory has been generated run: |