From 50fcbccb579ebc21d8cbfabfdef3b8a36410e0dd Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Mon, 9 Nov 2020 12:21:18 +0100 Subject: [PATCH 1/8] use official m.css repo (#64) --- documentation/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index e48fd95..8f5cbfe 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -11,9 +11,8 @@ CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..) CPMAddPackage( NAME MCSS DOWNLOAD_ONLY YES - # patched version until https://github.com/mosra/m.css/pull/171 is resolved - GITHUB_REPOSITORY TheLartians/m.css - GIT_TAG 1bf162b96d5bfefc9967a80cef138f1270ffa415 + GITHUB_REPOSITORY mosra/m.css + GIT_TAG 42d4a9a48f31f5df6e246c948403b54b50574a2a ) # ---- Doxygen variables ---- From eadea97fe49a29ba5566ad592f17bb04de79981c Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Tue, 10 Nov 2020 13:20:49 +0100 Subject: [PATCH 2/8] set CMAKE_BUILD_TYPE via configuration argument, closes #65 (#66) --- .github/workflows/macos.yml | 4 ++-- .github/workflows/standalone.yml | 2 +- .github/workflows/ubuntu.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cc82132..2fcbe9c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -20,10 +20,10 @@ jobs: - uses: actions/checkout@v1 - name: configure - run: cmake -Htest -Bbuild + run: cmake -Htest -Bbuild -DCMAKE_BUILD_TYPE=Debug - name: build - run: cmake --build build --config Debug -j4 + run: cmake --build build -j4 - name: test run: | diff --git a/.github/workflows/standalone.yml b/.github/workflows/standalone.yml index 85afe23..7fe2767 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v1 - name: configure - run: cmake -Hstandalone -Bbuild + run: cmake -Hstandalone -Bbuild -DCMAKE_BUILD_TYPE=Debug - name: build run: cmake --build build -j4 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index dd62cc8..29d1509 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -21,10 +21,10 @@ jobs: - uses: actions/checkout@v1 - name: configure - run: cmake -Htest -Bbuild -DENABLE_TEST_COVERAGE=1 + run: cmake -Htest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug - name: build - run: cmake --build build --config Debug -j4 + run: cmake --build build -j4 - name: test run: | From 8dc50e5294ac1d1c0d580c9b35327b9b47c6f3b2 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Fri, 18 Dec 2020 19:36:44 +0100 Subject: [PATCH 3/8] use namespaced target (#67) * use namespaced target * update .cmake-format for PackageProject.cmake 1.4 --- .cmake-format | 1 + CMakeLists.txt | 3 ++- standalone/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.cmake-format b/.cmake-format index a52c7d6..8c355cf 100644 --- a/.cmake-format +++ b/.cmake-format @@ -48,6 +48,7 @@ parse: kwargs: NAME: 1 VERSION: 1 + NAMESPACE: 1 INCLUDE_DIR: 1 INCLUDE_DESTINATION: 1 BINARY_DIR: 1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 4efa094..d12bd85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ include(cmake/CPM.cmake) CPMAddPackage( NAME PackageProject.cmake GITHUB_REPOSITORY TheLartians/PackageProject.cmake - VERSION 1.3 + VERSION 1.4 ) # ---- Add source files ---- @@ -67,6 +67,7 @@ string(TOLOWER ${PROJECT_NAME}/version.h VERSION_HEADER_LOCATION) packageProject( NAME ${PROJECT_NAME} VERSION ${PROJECT_VERSION} + NAMESPACE ${PROJECT_NAME} BINARY_DIR ${PROJECT_BINARY_DIR} INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} diff --git a/standalone/CMakeLists.txt b/standalone/CMakeLists.txt index 23ff942..4bb837d 100644 --- a/standalone/CMakeLists.txt +++ b/standalone/CMakeLists.txt @@ -27,4 +27,4 @@ add_executable(GreeterStandalone ${sources}) set_target_properties(GreeterStandalone PROPERTIES CXX_STANDARD 17 OUTPUT_NAME "Greeter") -target_link_libraries(GreeterStandalone Greeter cxxopts) +target_link_libraries(GreeterStandalone Greeter::Greeter cxxopts) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d62ce82..302d7f2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -39,7 +39,7 @@ CPMAddPackage( file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp) add_executable(GreeterTests ${sources}) -target_link_libraries(GreeterTests doctest Greeter) +target_link_libraries(GreeterTests doctest Greeter::Greeter) set_target_properties(GreeterTests PROPERTIES CXX_STANDARD 17) From 8ba41ae49cfb126712a8d42145b2b03a588a0c64 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Wed, 20 Jan 2021 19:00:20 +0100 Subject: [PATCH 4/8] Update CPM.cmake and cache dependencies in workflows (#70) * update CPM.cmake to 0.28.0 * cache CPM.cmake dependencies * create modules directory if it doesn't exist on windows * experiment with env variable * experiment 2 * experiment 3 * use env for all workflows * make cache keys OS dependent * replace env.GITHUB_ with github.workspace * format workflow files * update cache key * use unique key for each workflow --- .github/workflows/documentation.yaml | 11 ++++++-- .github/workflows/install.yml | 40 ++++++++++++++++------------ .github/workflows/macos.yml | 30 ++++++++++++--------- .github/workflows/standalone.yml | 26 +++++++++++------- .github/workflows/style.yml | 30 ++++++++++++--------- .github/workflows/ubuntu.yml | 34 +++++++++++++---------- .github/workflows/windows.yml | 30 ++++++++++++--------- cmake/CPM.cmake | 2 +- 8 files changed, 123 insertions(+), 80 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 3ee6d30..c745d66 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -3,7 +3,7 @@ name: Documentation on: push: tags: - - '*' + - "*" jobs: build: @@ -12,14 +12,21 @@ jobs: steps: - uses: actions/checkout@v1 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + - name: Install dependencies run: | brew install doxygen pip3 install jinja2 Pygments - name: Build + env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules run: | - cmake -Hdocumentation -Bbuild + cmake -Sdocumentation -Bbuild cmake --build build --target GenerateDocs - name: Publish diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 997da70..8dab9a5 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -13,25 +13,31 @@ env: jobs: build: - runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v1 - - - name: build and install library - run: | - cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release - sudo cmake --build build --target install - rm -rf build + - uses: actions/checkout@v1 - - name: configure - run: cmake -Htest -Bbuild -DTEST_INSTALLED_VERSION=1 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: build - run: cmake --build build --config Debug -j4 + - name: build and install library + run: | + cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release + sudo cmake --build build --target install + rm -rf build - - name: test - run: | - cd build - ctest --build-config Debug + - name: configure + env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + run: cmake -Stest -Bbuild -DTEST_INSTALLED_VERSION=1 + + - name: build + run: cmake --build build --config Debug -j4 + + - name: test + run: | + cd build + ctest --build-config Debug diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2fcbe9c..d2aa7ce 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -13,19 +13,25 @@ env: jobs: build: - runs-on: macos-latest - + steps: - - uses: actions/checkout@v1 - - - name: configure - run: cmake -Htest -Bbuild -DCMAKE_BUILD_TYPE=Debug + - uses: actions/checkout@v1 - - name: build - run: cmake --build build -j4 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: test - run: | - cd build - ctest --build-config Debug + - name: configure + env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + 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/standalone.yml b/.github/workflows/standalone.yml index 7fe2767..6827eb4 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -10,17 +10,23 @@ on: jobs: build: - runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v1 - - - name: configure - run: cmake -Hstandalone -Bbuild -DCMAKE_BUILD_TYPE=Debug + - uses: actions/checkout@v1 - - name: build - run: cmake --build build -j4 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: run - run: ./build/Greeter + - name: configure + env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + run: cmake -Sstandalone -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_TYPE=Debug + + - name: build + run: cmake --build build -j4 + + - name: run + run: ./build/Greeter diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 48d1fa5..711900c 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -10,19 +10,25 @@ on: jobs: build: - runs-on: macos-latest - + steps: - - uses: actions/checkout@v1 - - - name: Install format dependencies - run: | - brew install clang-format - pip3 install cmake_format==0.6.11 pyyaml + - uses: actions/checkout@v1 - - name: configure - run: cmake -Htest -Bbuild + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: check style - run: cmake --build build --target check-format + - name: Install format dependencies + run: | + brew install clang-format + pip3 install cmake_format==0.6.11 pyyaml + + - name: configure + env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + run: cmake -Stest -Bbuild + + - name: check style + run: cmake --build build --target check-format diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 29d1509..ca2c86d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -14,22 +14,28 @@ env: jobs: build: - runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v1 - - - name: configure - run: cmake -Htest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug + - uses: actions/checkout@v1 - - name: build - run: cmake --build build -j4 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: test - run: | - cd build - ctest --build-config Debug + - name: configure + env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + run: cmake -Stest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug - - name: collect code coverage - run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" + - 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 index 8f6d2b2..6d6e1b4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,19 +13,25 @@ env: jobs: build: - runs-on: windows-latest - + steps: - - uses: actions/checkout@v1 - - - name: configure - run: cmake -Htest -Bbuild + - uses: actions/checkout@v1 - - name: build - run: cmake --build build --config Debug -j4 + - uses: actions/cache@v2 + with: + path: "**/cpm_modules" + key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - - name: test - run: | - cd build - ctest --build-config Debug + - name: configure + env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + run: cmake -Stest -Bbuild + + - name: build + run: cmake --build build --config Debug -j4 + + - name: test + run: | + cd build + ctest --build-config Debug diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index bffba54..7e35741 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -1,4 +1,4 @@ -set(CPM_DOWNLOAD_VERSION 0.27.2) +set(CPM_DOWNLOAD_VERSION 0.28.0) if(CPM_SOURCE_CACHE) set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") From bd2b4aba5f63d73f42321ad1561b36a1a964c7f5 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Wed, 20 Jan 2021 19:03:12 +0100 Subject: [PATCH 5/8] add cpm_modules to gitignore (#71) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a4cfc5d..d54a4f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /build* /.vscode +/cpm_modules .DS_Store \ No newline at end of file From dd055e846caa2416c1113941abf8660a95ed50ec Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Wed, 20 Jan 2021 19:11:38 +0100 Subject: [PATCH 6/8] use correct workflow dependent key (#72) --- .github/workflows/documentation.yaml | 2 +- .github/workflows/install.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/standalone.yml | 2 +- .github/workflows/style.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- .github/workflows/windows.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index c745d66..1a34dcc 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -15,7 +15,7 @@ jobs: - uses: actions/cache@v2 with: path: "**/cpm_modules" - key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: Install dependencies run: | diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 8dab9a5..dbf796e 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/cache@v2 with: path: "**/cpm_modules" - key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: build and install library run: | diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d2aa7ce..95fa10b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/cache@v2 with: path: "**/cpm_modules" - key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: configure env: diff --git a/.github/workflows/standalone.yml b/.github/workflows/standalone.yml index 6827eb4..b4fc091 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/cache@v2 with: path: "**/cpm_modules" - key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: configure env: diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 711900c..926ffa9 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/cache@v2 with: path: "**/cpm_modules" - key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: Install format dependencies run: | diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ca2c86d..acc8b66 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/cache@v2 with: path: "**/cpm_modules" - key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: configure env: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6d6e1b4..111f75e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/cache@v2 with: path: "**/cpm_modules" - key: ${{ github.action }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: configure env: From db49d07ca129dac43d4c3fd5d5c5a0e1dd6e3d63 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Wed, 20 Jan 2021 19:44:04 +0100 Subject: [PATCH 7/8] update actions/checkout to v2 (#73) --- .github/workflows/documentation.yaml | 2 +- .github/workflows/install.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/standalone.yml | 2 +- .github/workflows/style.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- .github/workflows/windows.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 1a34dcc..4661a9c 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -10,7 +10,7 @@ jobs: name: Build and publish documentation runs-on: macos-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/cache@v2 with: diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index dbf796e..b34697a 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/cache@v2 with: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 95fa10b..ae25472 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -16,7 +16,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/cache@v2 with: diff --git a/.github/workflows/standalone.yml b/.github/workflows/standalone.yml index b4fc091..6afabb6 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/cache@v2 with: diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 926ffa9..25dd32f 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -13,7 +13,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/cache@v2 with: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index acc8b66..b98dd25 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/cache@v2 with: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 111f75e..734573e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -16,7 +16,7 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/cache@v2 with: From b58e0717f4a60274e5bdbaa32054cdd738933369 Mon Sep 17 00:00:00 2001 From: Lars Melchior Date: Thu, 21 Jan 2021 10:16:01 +0100 Subject: [PATCH 8/8] Merge envs in workflows (#74) * also use cache in install test * merge envs --- .github/workflows/documentation.yaml | 5 +++-- .github/workflows/install.yml | 5 ++--- .github/workflows/macos.yml | 3 +-- .github/workflows/standalone.yml | 5 +++-- .github/workflows/style.yml | 5 +++-- .github/workflows/ubuntu.yml | 3 +-- .github/workflows/windows.yml | 3 +-- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 4661a9c..8b12266 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -5,6 +5,9 @@ on: tags: - "*" +env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + jobs: build: name: Build and publish documentation @@ -23,8 +26,6 @@ jobs: pip3 install jinja2 Pygments - name: Build - env: - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules run: | cmake -Sdocumentation -Bbuild cmake --build build --target GenerateDocs diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index b34697a..606dddd 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -10,6 +10,7 @@ on: env: CTEST_OUTPUT_ON_FAILURE: 1 + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules jobs: build: @@ -25,13 +26,11 @@ jobs: - name: build and install library run: | - cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release + cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release sudo cmake --build build --target install rm -rf build - name: configure - env: - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules run: cmake -Stest -Bbuild -DTEST_INSTALLED_VERSION=1 - name: build diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ae25472..a2a098f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,6 +10,7 @@ on: env: CTEST_OUTPUT_ON_FAILURE: 1 + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules jobs: build: @@ -24,8 +25,6 @@ jobs: key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: configure - env: - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules run: cmake -Stest -Bbuild -DCMAKE_BUILD_TYPE=Debug - name: build diff --git a/.github/workflows/standalone.yml b/.github/workflows/standalone.yml index 6afabb6..5c3853e 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -8,6 +8,9 @@ on: branches: - master +env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + jobs: build: runs-on: ubuntu-latest @@ -21,8 +24,6 @@ jobs: key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: configure - env: - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules run: cmake -Sstandalone -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_TYPE=Debug - name: build diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 25dd32f..ba20a70 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -8,6 +8,9 @@ on: branches: - master +env: + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules + jobs: build: runs-on: macos-latest @@ -26,8 +29,6 @@ jobs: pip3 install cmake_format==0.6.11 pyyaml - name: configure - env: - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules run: cmake -Stest -Bbuild - name: check style diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index b98dd25..a36711d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -11,6 +11,7 @@ on: env: CTEST_OUTPUT_ON_FAILURE: 1 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules jobs: build: @@ -25,8 +26,6 @@ jobs: key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: configure - env: - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules run: cmake -Stest -Bbuild -DENABLE_TEST_COVERAGE=1 -DCMAKE_BUILD_TYPE=Debug - name: build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 734573e..a52b0ae 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,6 +10,7 @@ on: env: CTEST_OUTPUT_ON_FAILURE: 1 + CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules jobs: build: @@ -24,8 +25,6 @@ jobs: key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: configure - env: - CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules run: cmake -Stest -Bbuild - name: build