-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (74 loc) · 2.52 KB
/
build-matrix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: CMake Build Matrix
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest] # , macos-latest
include:
- os: windows-latest
compiler: msvc
- os: ubuntu-latest
compiler: gcc
# - os: macos-latest
# compiler: clang
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Install GCC 13.1
if: matrix.os == 'ubuntu-latest'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install -y gcc-13 g++-13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 60
- name: Cache Homebrew
if: matrix.os == 'macos-latest'
uses: actions/[email protected]
with:
path: /usr/local/Homebrew
key: ${{ runner.os }}-homebrew-${{ hashFiles('**/Brewfile') }}
restore-keys: |
${{ runner.os }}-homebrew-
- name: Install Clang 14
if: matrix.os == 'macos-latest'
run: |
brew update
brew install llvm@14
echo 'export PATH="/usr/local/opt/llvm@14/bin:$PATH"' >> ~/.zshrc
echo 'export LDFLAGS="-L/usr/local/opt/llvm@14/lib"' >> ~/.zshrc
echo 'export CPPFLAGS="-I/usr/local/opt/llvm@14/include"' >> ~/.zshrc
source ~/.zshrc
- name: Save Homebrew Cache
if: matrix.os == 'macos-latest'
uses: actions/cache@v3
with:
path: /usr/local/Homebrew
key: ${{ runner.os }}-homebrew-${{ hashFiles('**/Brewfile') }}
- name: vcpkg installation
shell: bash
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
if [[ "${{ runner.os }}" == "Windows" ]]; then
./bootstrap-vcpkg.bat
else
./bootstrap-vcpkg.sh
fi
./vcpkg integrate install
./vcpkg install
- name: Configure CMake
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: |
cmake --build build --config Release
- name: Run tests
run: |
ctest --test-dir ${{ github.workspace }}/output/bin/release --output-on-failure -C Release