forked from Tudat/tudat
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from tudat-team/feature/add-ccache
Feature/add ccache
- Loading branch information
Showing
2 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,34 +117,36 @@ jobs: | |
run: cmd /c "curl -fsSL https://raw.githubusercontent.com/tudat-team/tudat-resources-feedstock/master/recipe/post-link.bat | cmd" | ||
|
||
|
||
- name: Set reusable strings | ||
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | ||
id: strings | ||
shell: bash -l {0} | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
- name: Setup ccache | ||
# This third party action will setup ccache on the runner and restore any previously saved cache. Caches are saved automatically by the action after a build. | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ matrix.os }}-${{ matrix.type }} | ||
|
||
|
||
- name: Configure CMake | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
shell: bash -l {0} | ||
run: > | ||
cmake -B "${{ steps.strings.outputs.build-output-dir }}" | ||
cmake -B "${{ github.workspace }}/build" | ||
-S "${{ github.workspace }}" | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
-S "${{ github.workspace }}" | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache | ||
-DTUDAT_BUILD_GITHUB_ACTIONS=ON | ||
- name: Build | ||
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). Use multiple cpu cores available in the runner. | ||
shell: bash -l {0} | ||
run: cmake --build "${{ steps.strings.outputs.build-output-dir }}" --config "${{ matrix.build_type }}" -j4 | ||
run: cmake --build "${{ github.workspace }}/build" --config "${{ matrix.build_type }}" -j4 | ||
|
||
|
||
- name: Test | ||
working-directory: ${{ steps.strings.outputs.build-output-dir }} | ||
working-directory: "${{ github.workspace }}/build" | ||
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
# Prevent the action from failing if any of the tests fail by using `|| true`. This is placed temporarily because currently, some tests fail on MacOS, and if the action fails, the cache is not updated, which prevents testing of the cache feature on MacOS. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters