From 21320e29efdbb086ec811cac3f7fe4e70eceda94 Mon Sep 17 00:00:00 2001 From: Alexandre Tolstenko Date: Fri, 2 Dec 2022 09:53:33 -0500 Subject: [PATCH 1/7] feat: standalone multi os --- .github/workflows/standalone.yml | 8 ++++++-- .gitignore | 12 +++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/standalone.yml b/.github/workflows/standalone.yml index 5d64e872..115dd843 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -15,7 +15,11 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] steps: - uses: actions/checkout@v2 @@ -23,7 +27,7 @@ jobs: - uses: actions/cache@v2 with: path: "**/cpm_modules" - key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + key: ${{ matrix.os }}-${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: configure run: cmake -Sstandalone -Bbuild -DCMAKE_BUILD_TYPE=Debug diff --git a/.gitignore b/.gitignore index d54a4f4b..3897705a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,14 @@ /build* /.vscode /cpm_modules -.DS_Store \ No newline at end of file + +# apple +.DS_Store + +# clion +.idea/ +cmake-*/ + +# visual studio +out/ +.vs/ \ No newline at end of file From 1bfe0ea600d53a2e552964361160ded7c81e7097 Mon Sep 17 00:00:00 2001 From: Alexandre Tolstenko Date: Fri, 2 Dec 2022 10:00:39 -0500 Subject: [PATCH 2/7] fix: windows compilation --- .github/workflows/standalone.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/standalone.yml b/.github/workflows/standalone.yml index 115dd843..80226127 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -35,5 +35,10 @@ jobs: - name: build run: cmake --build build -j4 - - name: run + - name: run on unix-like + if: startsWith(matrix.os, 'macOS') || startsWith(matrix.os,'ubuntu') run: ./build/Greeter + + - name: run on windows + if: startsWith(matrix.os, 'windows') + run: ./build/Debug/Greeter.exe From 0a7a86ea47c0d8cb8f8b77c719a979c3d2dc101f Mon Sep 17 00:00:00 2001 From: Alexandre Tolstenko Date: Fri, 2 Dec 2022 10:17:41 -0500 Subject: [PATCH 3/7] feat: test on all platforms --- .github/workflows/test.yml | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..a3278457 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Test + +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + +env: + CTEST_OUTPUT_ON_FAILURE: 1 + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ matrix.os }}-${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + + - name: configure + run: cmake -Stest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug + + - name: build + run: cmake --build build -j4 + + - name: test + run: | + cd build + ctest --build-config Debug + + - name: collect code coverage on ubuntu + if: startsWith(matrix.os,'ubuntu') + run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" From f530172a7e376cf7604ead2bc557248b6c02a361 Mon Sep 17 00:00:00 2001 From: Alexandre Tolstenko Date: Fri, 2 Dec 2022 10:58:04 -0500 Subject: [PATCH 4/7] feat: remove old os based actions --- .github/workflows/macos.yml | 38 ------------------------------- .github/workflows/ubuntu.yml | 42 ----------------------------------- .github/workflows/windows.yml | 38 ------------------------------- 3 files changed, 118 deletions(-) delete mode 100644 .github/workflows/macos.yml delete mode 100644 .github/workflows/ubuntu.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index 7f82fedc..00000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: MacOS - -on: - push: - branches: - - master - - main - pull_request: - branches: - - master - - main - -env: - CTEST_OUTPUT_ON_FAILURE: 1 - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules - -jobs: - build: - runs-on: macos-latest - - steps: - - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: "**/cpm_modules" - key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - - name: configure - run: cmake -Stest -Bbuild -DCMAKE_BUILD_TYPE=Debug - - - name: build - run: cmake --build build -j4 - - - name: test - run: | - cd build - ctest --build-config Debug diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index 16e82afe..00000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Ubuntu - -on: - push: - branches: - - master - - main - pull_request: - branches: - - master - - main - -env: - CTEST_OUTPUT_ON_FAILURE: 1 - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: "**/cpm_modules" - key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - - name: configure - run: cmake -Stest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug - - - name: build - run: cmake --build build -j4 - - - name: test - run: | - cd build - ctest --build-config Debug - - - name: collect code coverage - run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 2d8ec467..00000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Windows - -on: - push: - branches: - - master - - main - pull_request: - branches: - - master - - main - -env: - CTEST_OUTPUT_ON_FAILURE: 1 - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules - -jobs: - build: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: "**/cpm_modules" - key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - - name: configure - run: cmake -Stest -Bbuild - - - name: build - run: cmake --build build --config Debug -j4 - - - name: test - run: | - cd build - ctest --build-config Debug From 5c1538f56e6c883ca3c0192194fea7c01c2b7172 Mon Sep 17 00:00:00 2001 From: Alexandre Tolstenko Date: Fri, 2 Dec 2022 10:58:14 -0500 Subject: [PATCH 5/7] feat: add release action --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ CMakeLists.txt | 5 +++ 2 files changed, 63 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 00000000..2b155123 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release + +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + +env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ matrix.os }}-${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + + - name: configure + run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release + + - name: build + run: cmake --build build -j4 --config Release + + - name: zip + uses: thedoctor0/zip-release@main + with: + type: zip + filename: ${{ matrix.os }}.zip + directory: build/out/ + + - name: ls + run: ls + + - name: ls + run: ls build + + - name: ls + run: ls build/out + + - uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: build/out/${{ matrix.os }}.zip + tag: latest diff --git a/CMakeLists.txt b/CMakeLists.txt index c206ed6b..ec065538 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,11 @@ if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) ) endif() +# ---- Set output directories ---- +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out) + # ---- Add dependencies via CPM ---- # see https://github.com/TheLartians/CPM.cmake for more info From ed170b91a96b2683c6aa7536fb489706ead4c0cc Mon Sep 17 00:00:00 2001 From: Alexandre Tolstenko Date: Fri, 2 Dec 2022 12:21:54 -0500 Subject: [PATCH 6/7] feat: nightly builds --- .github/workflows/release.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b155123..8332354d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,8 @@ name: Release on: push: + tags: + - '*' branches: - master - main @@ -35,6 +37,10 @@ jobs: - name: build run: cmake --build build -j4 --config Release + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + - name: zip uses: thedoctor0/zip-release@main with: @@ -42,17 +48,8 @@ jobs: filename: ${{ matrix.os }}.zip directory: build/out/ - - name: ls - run: ls - - - name: ls - run: ls build - - - name: ls - run: ls build/out - - uses: ncipollo/release-action@v1 with: allowUpdates: true artifacts: build/out/${{ matrix.os }}.zip - tag: latest + tag: nightly-${{ steps.date.outputs.date }} From 09c095f21e5b60a58bf99f879411330bf4772b19 Mon Sep 17 00:00:00 2001 From: Alexandre Tolstenko Date: Fri, 3 Mar 2023 17:22:18 -0500 Subject: [PATCH 7/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46b6226d..77198bb7 100644 --- a/README.md +++ b/README.md @@ -205,4 +205,4 @@ Perhaps the [MiniCppStarter](https://github.com/TheLartians/MiniCppStarter) is s ## Star History -[![Star History Chart](https://api.star-history.com/svg?repos=TheLartians/ModernCppStarter,cpp-best-practices/gui_starter_template,filipdutescu/modern-cpp-template&type=Date)](https://star-history.com/#TheLartians/ModernCppStarter&cpp-best-practices/gui_starter_template&filipdutescu/modern-cpp-template&Date) +[![Star History Chart](https://api.star-history.com/svg?repos=TheLartians/ModernCppStarter,cpp-best-practices/gui_starter_template,filipdutescu/modern-cpp-template&type=Date)](https://star-history.com/#TheLartians/ModernCppStarter&cpp-best-practices/gui_starter_template&filipdutescu/modern-cpp-template&Date)