-
Notifications
You must be signed in to change notification settings - Fork 11
137 lines (121 loc) · 5.28 KB
/
ci.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: CMake
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ created ]
jobs:
build:
name: "${{ matrix.configurations.name }} | ${{ matrix.cmake-build-type }}"
environment: configure coverage
runs-on: ${{ matrix.configurations.os }}
strategy:
fail-fast: false
matrix:
configurations:
- name: Ubuntu gcc12
os: ubuntu-22.04 # pre-release, ubuntu-latest still points to ubuntu-2004
compiler: gcc
- name: Ubuntu clang15
os: ubuntu-22.04 # pre-release, ubuntu-latest still points to ubuntu-2004
compiler: clang15
- name: Ubuntu Latest clang16
os: ubuntu-22.04 # pre-release, ubuntu-latest still points to ubuntu-2004
compiler: clang16
- name: Ubuntu Latest emscripten
os: ubuntu-22.04 # pre-release, ubuntu-latest still points to ubuntu-2004
compiler: emscripten
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
cmake-build-type: [ Release, Debug ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100
- name: Cache
uses: actions/cache@v3
env:
cache-name: cache-fetchContent-cache
with:
path: ${{runner.workspace}}/build/_deps
key: ${{ runner.os }}-${{ matrix.configurations.compiler }}-${{ matrix.cmake-build-type }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Dependencies.cmake') }}
- name: Install gcc-12
if: matrix.configurations.compiler == 'gcc'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa # provides newer gcc 12.2.0 instead of 12.1.0
sudo apt-get install -y gcc-12 g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 110 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
# - name: Install clang-15
# if: matrix.configurations.compiler == 'clang15'
# run: |
# wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
# sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main'
# sudo apt update
# sudo apt install -y clang-15 libc++-15-dev libc++abi-15-dev
# sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-15 110
- name: Install clang-15
if: matrix.configurations.compiler == 'clang15'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main'
sudo apt update
sudo apt install -y clang-15 libc++-15-dev libc++abi-15-dev
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-15 110
- name: Install clang-16
if: matrix.configurations.compiler == 'clang16'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main'
sudo apt update
sudo apt install -y clang-16 libc++-16-dev libc++abi-16-dev
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-16 110
- name: Install emscripten
if: matrix.configurations.compiler == 'emscripten'
run: |
cd
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
# Download and install the latest SDK tools.
./emsdk install releases-03ecb526947f6a3702a0d083083799fe410d3893-64bit
# Make the "latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate releases-03ecb526947f6a3702a0d083083799fe410d3893-64bit
# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
- name: Configure CMake
if: matrix.configurations.compiler != 'emscripten'
shell: bash
run: cmake -S . -B ../build -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DENABLE_COVERAGE=${{ matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug'}}
- name: Configure CMake Emscripten
if: matrix.configurations.compiler == 'emscripten'
shell: bash
run: |
source ~/emsdk/emsdk_env.sh
emcmake cmake -S . -B ../build -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DENABLE_COVERAGE=OFF
- name: Build
if: matrix.configurations.compiler != 'emscripten'
shell: bash
run: cmake --build ../build --config ${{ matrix.cmake-build-type }}
- name: Build Emscripten
if: matrix.configurations.compiler == 'emscripten'
shell: bash
run: |
source ~/emsdk/emsdk_env.sh
cd ../build
emmake make
- name: execute tests
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest --output-on-failure
- name: execute binary
if: matrix.configurations.compiler != 'emscripten'
working-directory: ${{runner.workspace}}/build
shell: bash
run: ./src/main
- name: execute binary
if: matrix.configurations.compiler == 'emscripten'
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
source ~/emsdk/emsdk_env.sh
node --experimental-wasm-threads ./src/main.js