| 1 |
name: CMake Build Matrix |
| 2 |
|
| 3 |
on: [ push, pull_request ] |
| 4 |
|
| 5 |
jobs: |
| 6 |
build: |
| 7 |
name: ${{ matrix.config.name }} |
| 8 |
runs-on: ${{ matrix.config.os }} |
| 9 |
strategy: |
| 10 |
fail-fast: false |
| 11 |
matrix: |
| 12 |
config: |
| 13 |
- name: "Ubuntu 20.04 GCC 9.3" |
| 14 |
os: ubuntu-20.04 |
| 15 |
build_type: Release |
| 16 |
packages: ninja-build |
| 17 |
generator: Ninja |
| 18 |
compatibility: "cxx_std_11;cxx_std_17;cxx_std_20" |
| 19 |
cc: gcc |
| 20 |
cxx: g++ |
| 21 |
|
| 22 |
- name: "Ubuntu 20.04 Clang 10.0" |
| 23 |
os: ubuntu-20.04 |
| 24 |
build_type: Release |
| 25 |
packages: ninja-build |
| 26 |
generator: Ninja |
| 27 |
compatibility: "cxx_std_11;cxx_std_17;cxx_std_20" |
| 28 |
cc: clang-10 |
| 29 |
cxx: clang++-10 |
| 30 |
|
| 31 |
- name: "Ubuntu 20.04 Clang 11.0" |
| 32 |
os: ubuntu-20.04 |
| 33 |
build_type: Release |
| 34 |
packages: ninja-build clang-11 libc++-11-dev libc++abi-11-dev |
| 35 |
generator: Ninja |
| 36 |
compatibility: "cxx_std_11;cxx_std_17;cxx_std_20" |
| 37 |
cc: clang-11 |
| 38 |
cxx: clang++-11 |
| 39 |
|
| 40 |
- name: "Ubuntu 20.04 GCC 9.3 coverage" |
| 41 |
os: ubuntu-20.04 |
| 42 |
build_type: Debug |
| 43 |
packages: ninja-build lcov |
| 44 |
generator: Ninja |
| 45 |
compatibility: "cxx_std_11;cxx_std_17;cxx_std_20" |
| 46 |
cc: gcc |
| 47 |
cxx: g++ |
| 48 |
|
| 49 |
- name: "Ubuntu 18.04 GCC 8.4" |
| 50 |
os: ubuntu-18.04 |
| 51 |
build_type: Release |
| 52 |
packages: ninja-build gcc-8 g++-8 |
| 53 |
generator: Ninja |
| 54 |
compatibility: "cxx_std_11;cxx_std_17" |
| 55 |
cc: gcc-8 |
| 56 |
cxx: g++-8 |
| 57 |
|
| 58 |
- name: "Ubuntu 18.04 GCC 7.5" |
| 59 |
os: ubuntu-18.04 |
| 60 |
build_type: Release |
| 61 |
packages: ninja-build |
| 62 |
generator: Ninja |
| 63 |
compatibility: "cxx_std_11;cxx_std_17" |
| 64 |
cc: gcc-7 |
| 65 |
cxx: g++-7 |
| 66 |
|
| 67 |
- name: "Ubuntu 18.04 GCC 6.5" |
| 68 |
os: ubuntu-18.04 |
| 69 |
build_type: Release |
| 70 |
packages: ninja-build gcc-6 g++-6 |
| 71 |
generator: Ninja |
| 72 |
compatibility: "cxx_std_11;cxx_std_17" |
| 73 |
cc: gcc-6 |
| 74 |
cxx: g++-6 |
| 75 |
|
| 76 |
- name: "Ubuntu 18.04 GCC 5.5" |
| 77 |
os: ubuntu-18.04 |
| 78 |
build_type: Release |
| 79 |
packages: ninja-build gcc-5 g++-5 |
| 80 |
generator: Ninja |
| 81 |
compatibility: "cxx_std_11;cxx_std_17" |
| 82 |
cc: gcc-5 |
| 83 |
cxx: g++-5 |
| 84 |
|
| 85 |
- name: "Ubuntu 18.04 Clang 9.0" |
| 86 |
os: ubuntu-18.04 |
| 87 |
build_type: Release |
| 88 |
packages: ninja-build libc++-9-dev libc++abi-9-dev |
| 89 |
generator: Ninja |
| 90 |
compatibility: "cxx_std_11;cxx_std_17;cxx_std_20" |
| 91 |
cc: clang |
| 92 |
cxx: clang++ |
| 93 |
|
| 94 |
- name: "Ubuntu 18.04 Clang 6.0" |
| 95 |
os: ubuntu-18.04 |
| 96 |
build_type: Release |
| 97 |
packages: ninja-build clang-6.0 |
| 98 |
generator: Ninja |
| 99 |
compatibility: "cxx_std_11;cxx_std_17" |
| 100 |
cc: clang-6.0 |
| 101 |
cxx: clang++-6.0 |
| 102 |
|
| 103 |
- name: "Ubuntu 18.04 Clang 5.0" |
| 104 |
os: ubuntu-18.04 |
| 105 |
build_type: Release |
| 106 |
packages: ninja-build clang-5.0 |
| 107 |
generator: Ninja |
| 108 |
compatibility: "cxx_std_11;cxx_std_17" |
| 109 |
cc: clang-5.0 |
| 110 |
cxx: clang++-5.0 |
| 111 |
|
| 112 |
- name: "Windows MSVC 2019" |
| 113 |
os: windows-latest |
| 114 |
build_type: Release |
| 115 |
packages: ninja |
| 116 |
generator: "Visual Studio 16 2019" |
| 117 |
compatibility: "cxx_std_11;cxx_std_17;cxx_std_20" |
| 118 |
cc: cl |
| 119 |
cxx: cl |
| 120 |
|
| 121 |
- name: "macOS 10.15 AppleClang" |
| 122 |
os: macos-10.15 |
| 123 |
build_type: Release |
| 124 |
packages: ninja |
| 125 |
generator: Ninja |
| 126 |
compatibility: "cxx_std_11;cxx_std_17" |
| 127 |
cc: clang |
| 128 |
cxx: clang++ |
| 129 |
|
| 130 |
steps: |
| 131 |
- uses: actions/checkout@v2 |
| 132 |
|
| 133 |
- name: print environment |
| 134 |
run: | |
| 135 |
echo github.event.action: ${{ github.event.action }} |
| 136 |
echo github.event_name: ${{ github.event_name }} |
| 137 |
|
| 138 |
- name: Install dependencies on Ubuntu |
| 139 |
if: startsWith(matrix.config.os, 'ubuntu') |
| 140 |
shell: bash |
| 141 |
run: | |
| 142 |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
| 143 |
sudo apt update |
| 144 |
sudo apt install ${{ matrix.config.packages }} |
| 145 |
|
| 146 |
- name: Install dependencies on windows |
| 147 |
if: startsWith(matrix.config.os, 'windows') |
| 148 |
run: | |
| 149 |
choco install ${{ matrix.config.packages }} |
| 150 |
|
| 151 |
- name: Install dependencies on macOS |
| 152 |
if: startsWith(matrix.config.os, 'macos') |
| 153 |
run: | |
| 154 |
brew install ${{ matrix.config.packages }} |
| 155 |
|
| 156 |
- name: Configure project |
| 157 |
shell: bash |
| 158 |
run: | |
| 159 |
export CC=${{ matrix.config.cc }} |
| 160 |
export CXX=${{ matrix.config.cxx }} |
| 161 |
ninja --version |
| 162 |
cmake --version |
| 163 |
mkdir build |
| 164 |
mkdir install |
| 165 |
if [[ "${{ matrix.config.build_type }}" == "Debug" ]]; then |
| 166 |
cmake -G "${{ matrix.config.generator }}" -S . -B build -DCMAKE_BUILD_TYPE=Debug -DGHC_COVERAGE=ON -DGHC_FILESYSTEM_TEST_COMPILE_FEATURES="${{ matrix.config.compatibility }}" -DCMAKE_INSTALL_PREFIX:PATH=install |
| 167 |
else |
| 168 |
cmake -G "${{ matrix.config.generator }}" -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DGHC_FILESYSTEM_TEST_COMPILE_FEATURES="${{ matrix.config.compatibility }}" -DCMAKE_INSTALL_PREFIX:PATH=install |
| 169 |
fi |
| 170 |
|
| 171 |
- name: Build project |
| 172 |
shell: bash |
| 173 |
run: | |
| 174 |
cmake --build build --config ${{ matrix.config.build_type }} |
| 175 |
|
| 176 |
- name: Run tests |
| 177 |
run: | |
| 178 |
cd build && ctest -C ${{ matrix.config.build_type }} |
| 179 |
|
| 180 |
- name: Collect coverage info |
| 181 |
if: startsWith(matrix.config.build_type, 'Debug') |
| 182 |
run: | |
| 183 |
cd build |
| 184 |
lcov --compat-libtool --directory . --capture --output-file coverage_output.info |
| 185 |
lcov --remove coverage_output.info '/usr/*' '*/c++/*' '*.h' '*/catch.hpp' -o coverage.info |
| 186 |
# sed -i 's|SF:/.*/filesystem/|SF:../|g' coverage.info |
| 187 |
|
| 188 |
- name: Upload coverage info |
| 189 |
if: startsWith(matrix.config.build_type, 'Debug') |
| 190 |
env: |
| 191 |
COVERALLS_DEBUG: true |
| 192 |
NODE_COVERALLS_DEBUG: 1 |
| 193 |
uses: coverallsapp/github-action@master |
| 194 |
with: |
| 195 |
path-to-lcov: ${{ github.workspace }}/build/coverage.info |
| 196 |
github-token: ${{ secrets.GITHUB_TOKEN }} |
| 197 |
|