1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-08-30 21:51:12 +02:00
This commit is contained in:
Alexandre Tolstenko 2022-12-02 17:44:01 +00:00 committed by GitHub
commit 9fd0d78713
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 92 additions and 84 deletions

View file

@ -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

55
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,55 @@
name: Release
on:
push:
tags:
- '*'
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: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: zip
uses: thedoctor0/zip-release@main
with:
type: zip
filename: ${{ matrix.os }}.zip
directory: build/out/
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: build/out/${{ matrix.os }}.zip
tag: nightly-${{ steps.date.outputs.date }}

View file

@ -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
@ -31,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

View file

@ -1,4 +1,4 @@
name: Ubuntu
name: Test
on:
push:
@ -17,7 +17,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
@ -25,7 +29,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 -Stest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug
@ -38,5 +42,6 @@ jobs:
cd build
ctest --build-config Debug
- name: collect code coverage
- 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"

View file

@ -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

12
.gitignore vendored
View file

@ -1,4 +1,14 @@
/build*
/.vscode
/cpm_modules
.DS_Store
# apple
.DS_Store
# clion
.idea/
cmake-*/
# visual studio
out/
.vs/

View file

@ -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