Skip to content

Commit

Permalink
Split 'Build + Test' CI into different jobs per OS
Browse files Browse the repository at this point in the history
  • Loading branch information
SSoelvsten committed Mar 8, 2023
1 parent 78d43fe commit 7ee5ed9
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 106 deletions.
103 changes: 5 additions & 98 deletions .github/workflows/unit_test.yml → .github/workflows/test_linux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: unit tests
name: test (Linux)

on:
push:
Expand All @@ -10,7 +10,7 @@ on:

jobs:
skip_duplicate:
name: 'Check whether to skip job'
name: 'Skip job? (Linux)'
continue-on-error: true
runs-on: ubuntu-latest

Expand All @@ -23,8 +23,8 @@ jobs:
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}

linux_test:
name: 'Unit test (Linux, ${{matrix.cc.cc}}-${{matrix.cc.v}}, ${{matrix.build_type}})'
build_test:
name: 'Build + Test (Linux, ${{matrix.cc.cc}}-${{matrix.cc.v}}, ${{matrix.build_type}})'
runs-on: ${{ matrix.os }}

needs: skip_duplicate
Expand All @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Release] #, Debug, ExtraDebug]
build_type: [Release, Debug]
cc:
# GNU Compiler
- { cc: gcc, v: 7, cxx: g++ } # oldest possible
Expand Down Expand Up @@ -116,96 +116,3 @@ jobs:
sudo apt install python3 python3-pip
pip install cmakeast
python3 scripts/check_missing_ctests.py
macos_test:
name: 'Unit 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, ExtraDebug]
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
116 changes: 116 additions & 0 deletions .github/workflows/test_mac.yml
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build (windows)
name: test (Windows)

on:
push:
Expand All @@ -10,21 +10,21 @@ on:

jobs:
skip_duplicate:
name: 'Check whether to skip job'
name: 'Skip job? (Windows)'
continue-on-error: true
runs-on: ubuntu-latest

steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths: '["tpie/"]'
paths: '["tpie/", "test/"]'

outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}

build:
name: 'Build (Windows, ${{matrix.build_type}})'
build_test:
name: 'Build + Test (Windows, ${{matrix.build_type}})'
runs-on: windows-latest

needs: skip_duplicate
Expand All @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug, ExtraDebug]
build_type: [Release, Debug]

steps:
# Git repo set up
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

# Run unit tests
- name: NMake test
- name: CTest run
run: |
cd ${{github.workspace}}\build
ctest
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# TPIE - The Templated Portable I/O Environment

[![LGPL-3.0 License](https://img.shields.io/badge/license-LGPL%203.0-blue.svg)](COPYING.md)
[![unit tests](https://github.com/thomasmoelhave/tpie/actions/workflows/unit_test.yml/badge.svg)](https://github.com/thomasmoelhave/tpie/actions/workflows/unit_test.yml)
[![test (Linux)](https://github.com/thomasmoelhave/tpie/actions/workflows/test_linux.yml/badge.svg)](https://github.com/thomasmoelhave/tpie/actions/workflows/test_linux.yml)
[![test (Mac OS)](https://github.com/thomasmoelhave/tpie/actions/workflows/test_macos.yml/badge.svg)](https://github.com/thomasmoelhave/tpie/actions/workflows/test_macos.yml)
[![test (Windows)](https://github.com/thomasmoelhave/tpie/actions/workflows/test_windows.yml/badge.svg)](https://github.com/thomasmoelhave/tpie/actions/workflows/test_windows.yml)
[![documentation](https://github.com/thomasmoelhave/tpie/actions/workflows/doxygen.yml/badge.svg)](https://thomasmoelhave.github.io/tpie)

The TPIE (Templated Portable I/O Environment) library is a tool box providing
Expand Down

0 comments on commit 7ee5ed9

Please sign in to comment.