mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-08-30 21:51:12 +02:00
Merge ed170b91a9
into a13bc56bcb
This commit is contained in:
commit
9fd0d78713
7 changed files with 92 additions and 84 deletions
38
.github/workflows/macos.yml
vendored
38
.github/workflows/macos.yml
vendored
|
@ -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
55
.github/workflows/release.yml
vendored
Normal 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 }}
|
15
.github/workflows/standalone.yml
vendored
15
.github/workflows/standalone.yml
vendored
|
@ -15,7 +15,11 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -23,7 +27,7 @@ jobs:
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "**/cpm_modules"
|
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
|
- name: configure
|
||||||
run: cmake -Sstandalone -Bbuild -DCMAKE_BUILD_TYPE=Debug
|
run: cmake -Sstandalone -Bbuild -DCMAKE_BUILD_TYPE=Debug
|
||||||
|
@ -31,5 +35,10 @@ jobs:
|
||||||
- name: build
|
- name: build
|
||||||
run: cmake --build build -j4
|
run: cmake --build build -j4
|
||||||
|
|
||||||
- name: run
|
- name: run on unix-like
|
||||||
|
if: startsWith(matrix.os, 'macOS') || startsWith(matrix.os,'ubuntu')
|
||||||
run: ./build/Greeter
|
run: ./build/Greeter
|
||||||
|
|
||||||
|
- name: run on windows
|
||||||
|
if: startsWith(matrix.os, 'windows')
|
||||||
|
run: ./build/Debug/Greeter.exe
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
name: Ubuntu
|
name: Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -17,7 +17,11 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -25,7 +29,7 @@ jobs:
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "**/cpm_modules"
|
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
|
- name: configure
|
||||||
run: cmake -Stest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug
|
run: cmake -Stest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug
|
||||||
|
@ -38,5 +42,6 @@ jobs:
|
||||||
cd build
|
cd build
|
||||||
ctest --build-config Debug
|
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"
|
run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
|
38
.github/workflows/windows.yml
vendored
38
.github/workflows/windows.yml
vendored
|
@ -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
12
.gitignore
vendored
|
@ -1,4 +1,14 @@
|
||||||
/build*
|
/build*
|
||||||
/.vscode
|
/.vscode
|
||||||
/cpm_modules
|
/cpm_modules
|
||||||
.DS_Store
|
|
||||||
|
# apple
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# clion
|
||||||
|
.idea/
|
||||||
|
cmake-*/
|
||||||
|
|
||||||
|
# visual studio
|
||||||
|
out/
|
||||||
|
.vs/
|
|
@ -18,6 +18,11 @@ if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||||
)
|
)
|
||||||
endif()
|
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 ----
|
# ---- Add dependencies via CPM ----
|
||||||
# see https://github.com/TheLartians/CPM.cmake for more info
|
# see https://github.com/TheLartians/CPM.cmake for more info
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue