-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split 'Build + Test' CI into different jobs per OS
- Loading branch information
1 parent
78d43fe
commit 7ee5ed9
Showing
4 changed files
with
131 additions
and
106 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
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 |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: test (Mac OS) | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
skip_duplicate: | ||
name: 'Skip job? (Mac OS)' | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@master | ||
with: | ||
paths: '["tpie/", "test/"]' | ||
|
||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
|
||
build_test: | ||
name: 'Build + Test (Mac OS, ${{matrix.cc.cc}}@${{matrix.cc.v || matrix.cc.xcode}}, ${{matrix.build_type}})' | ||
runs-on: ${{ matrix.os }} | ||
|
||
needs: skip_duplicate | ||
if: ${{ needs.skip_duplicate.outputs.should_skip != 'true' }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest] | ||
build_type: [Release, Debug] | ||
cc: | ||
# GNU Compiler | ||
- { cc: gcc, v: 7, cxx: g++, xcode: latest } | ||
- { cc: gcc, v: 10, cxx: g++, xcode: latest } | ||
|
||
# Clang Compiler | ||
- { cc: clang, cxx: clang++, xcode: 11.7 } # oldest | ||
- { cc: clang, cxx: clang++, xcode: 12.4 } | ||
- { cc: clang, cxx: clang++, xcode: 13.1 } | ||
- { cc: clang, cxx: clang++, xcode: 13.2 } # newest | ||
|
||
steps: | ||
# Git repo set up | ||
- name: Checkout commit | ||
uses: actions/checkout@v2 | ||
|
||
# Install dependencies | ||
- name: Install xcode | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: ${{matrix.cc.xcode}} | ||
|
||
- name: Install dependencies | ||
run: | | ||
brew update | ||
if ["${{matrix.cc.cc}}" == "gcc"]; | ||
then | ||
echo "================================" | ||
echo "Compiler" | ||
brew install ${{matrix.cc.cc}}@${{matrix.cc.v}} | ||
fi | ||
echo "================================" | ||
echo "Boost" | ||
brew install boost | ||
echo "================================" | ||
echo "Snappy" | ||
brew install snappy | ||
echo "================================" | ||
echo "LZ4" | ||
brew install lz4 | ||
echo "================================" | ||
echo "ZSTD" | ||
brew install zstd | ||
# CMake build and run | ||
- name: CMake build | ||
working-directory: ${{runner.workspace}} | ||
run: | | ||
if [ "${{ matrix.cc.cc }}" == "gcc" ] ; | ||
then | ||
export CC=/usr/bin/${{matrix.cc.cc}} | ||
export CXX=/usr/bin/${{matrix.cc.cxx}} | ||
else | ||
export CC=${{matrix.cc.cc}} | ||
export CXX=${{matrix.cc.cxx}} | ||
fi | ||
cmake -E make_directory ${{github.workspace}}/build | ||
cd ${{github.workspace}}/build | ||
cmake -D CMAKE_BUILD_TYPE="${{matrix.build_type}}" -D CMAKE_CXX_STANDARD=14 .. | ||
make -j2 | ||
- name: CTest run | ||
working-directory: ${{github.workspace}}/build | ||
run: ctest --timeout 30 | ||
|
||
# Check if tests are missing | ||
- name: Check missing CTests | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
brew install python3 | ||
pip3 install cmakeast | ||
python3 scripts/check_missing_ctests.py |
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
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