-
-
Notifications
You must be signed in to change notification settings - Fork 2
125 lines (102 loc) · 3.89 KB
/
ci.yaml
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
name: ci
on:
push:
branches-ignore:
- "gh-pages"
paths:
- "**.hpp"
- "**.cpp"
- "**.inl"
- "**/meson.build"
- "**/workflows/**.yaml"
pull_request:
branches-ignore:
- "gh-pages"
paths:
- "**.hpp"
- "**.cpp"
- "**.inl"
- "**/meson.build"
- "**/workflows/**.yaml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
clang_version: "15"
gcc_version: "12"
jobs:
linux:
strategy:
matrix:
compiler:
- "clang"
- "gcc"
linker:
- "lld"
type:
- "debug"
- "release"
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
steps:
- name: Install base dependencies
run: |
sudo apt -y update
sudo apt -y install --no-install-recommends git python3 python3-pip ninja-build libstdc++-${{ env.gcc_version }}-dev
sudo -H pip3 install --no-cache-dir --upgrade meson
- name: Install lld
if: ${{ startsWith(matrix.linker, 'lld') }}
run: |
sudo apt -y install --no-install-recommends lld-${{ env.clang_version }}
sudo update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-${{ env.clang_version }} 1000
- name: Install clang
if: ${{ startsWith(matrix.compiler, 'clang') }}
run: |
sudo apt -y install --no-install-recommends clang-${{ env.clang_version }}
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${{ env.clang_version }} 1000
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${{ env.clang_version }} 1000
- name: Install gcc
if: ${{ startsWith(matrix.compiler, 'gcc') }}
run: |
sudo apt -y install --no-install-recommends gcc-${{ env.gcc_version }} g++-${{ env.gcc_version }}
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${{ env.gcc_version }} 1000
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${{ env.gcc_version }} 1000
- uses: actions/checkout@v3
with:
submodules: true
- name: Configure Meson
run: |
if [ ${{ matrix.compiler }} = gcc ]; then pch=false; else pch=true; fi
CC=cc CXX=c++ CXX_LD=${{ matrix.linker }} meson setup build --buildtype=${{ matrix.type }} -Dpedantic=true -Dbuild_tests=true -Dbuild_examples=true -Db_pch=$pch
- name: Build
run: meson compile -C build --jobs -1
- name: Test
run: meson test -C build --verbose
windows:
strategy:
matrix:
type:
- "debug"
- "release"
runs-on: windows-2022
defaults:
run:
shell: cmd
steps:
- name: Install dependencies
run: |
python3 -m pip install -U pip==21.3.1
pip3 install --no-cache-dir --upgrade meson ninja
- uses: actions/checkout@v3
with:
submodules: true
- uses: ilammy/msvc-dev-cmd@v1
- name: Configure Meson
run: meson setup build --vsenv --buildtype=${{ matrix.type }} -Dpedantic=true -Dbuild_tests=true
- name: Build
run: meson compile -C build --jobs -1
- name: Test
run: meson test -C build --verbose