-
Notifications
You must be signed in to change notification settings - Fork 35
167 lines (151 loc) · 4.62 KB
/
c-cpp.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: C/C++ CI
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
on:
push:
branches: master
paths:
- '**'
- '!**.yml'
- '!**/.github'
- '!**.md'
- '!docker/**'
- '!packaging/**'
- '**/c-cpp.yml'
pull_request:
branches: master
paths:
- '**'
- '!**.yml'
- '!**/.github'
- '!**.md'
- '!docker/**'
- '!packaging/**'
- '**/c-cpp.yml'
env:
TERM: xterm
jobs:
build:
name: ${{ matrix.build.name }}
strategy:
fail-fast: false
matrix:
build:
- name: ubuntu-20.04-gcc
os: ubuntu-20.04
cc: gcc
dist: true
- name: ubuntu-20.04-clang
os: ubuntu-20.04
cc: clang
- name: ubuntu-22.04-gcc
os: ubuntu-22.04
cc: gcc
- name: ubuntu-22.04-clang
os: ubuntu-22.04
cc: clang
- name: Slackware
os: ubuntu-20.04
container: 'andy5995/slackware-build-essential:15.0'
- name: debian bullseye
os: ubuntu-20.04
container: 'andy5995/rmw-build-env:bookworm'
- name: ubuntu-22.04-without-nls
os: ubuntu-22.04
setup: -Dnls=false
- name: ubuntu-22.04-without-curses
os: ubuntu-22.04
setup: -Dwithout-curses=true
- name: Alpine
os: ubuntu-22.04
container: andy5995/rmw-build-env:alpine
setup_options: -Db_sanitize=none
- name: macos-latest-brew-canfigger
os: macos-latest
install_packages: canfigger
setup_options: --wrap-mode nofallback
- name: macos-latest-bundled-canfigger
os: macos-latest
runs-on: ${{ matrix.build.os }}
container: ${{ matrix.build.container }}
env:
CC: '${{ matrix.build.cc }}'
steps:
- uses: actions/checkout@v4
with:
submodules: false
- if: ${{ env.CC }}
run: |
if [ "$CC" = "gcc" ]; then
CXX=g++
else
CXX=clang++
fi
echo "CXX=${CXX}" >> $GITHUB_ENV
- name: Show info
run: |
export -p
echo '${{ toJSON(matrix) }}'
- if: ${{ contains(matrix.build.os, 'macos') }}
run: |
pip3 install meson ninja
brew update
brew install \
ncurses \
pkg-config \
${{ matrix.build.install_packages }}
#- if: ${{ contains(matrix.os, 'ubuntu') }}
#run: |
#sudo apt-get update -qq
#sudo apt-get upgrade -y -qq
#- if: ${{ matrix.cc == 'clang' && matrix.os != 'macos-latest' }}
#run: sudo apt-get install -y $CC $CXX
- if: ${{ matrix.build.os == 'ubuntu-22.04' && matrix.build.container == null }}
name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28
- if: ${{ contains(matrix.build.os, 'ubuntu') && matrix.build.container == null }}
run: |
sudo apt-get install -y \
python3-pip \
python3-setuptools \
xvfb # for test
sudo -H python3 -m pip install meson ninja
- if: ${{ contains(matrix.build.name, 'without-nls') && matrix.build.container == null }}
run: sudo apt remove -y gettext
- if: ${{ contains(matrix.build.name, 'without-nls') == false && matrix.build.container == null && contains(matrix.build.os, 'macos') == false }}
run: sudo apt install -y gettext
- name: Configure
run: meson setup builddir ${{ matrix.build.setup_options }}
- name: Build
run: |
cd builddir
ninja -v
- name: Test
run: cd builddir && meson test -v
- name: Test fake media root
run: cd builddir && meson test -v --setup=fake_media_root --suite rmw
- if: ${{ contains(matrix.build.name, 'dist') }}
run: cd builddir && meson dist --include-subprojects
openbsd:
runs-on: ubuntu-22.04
name: A job to run test in OpenBSD
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Test in OpenBSD
id: test
uses: vmactions/openbsd-vm@v1
with:
usesh: true
prepare: |
pkg_add gettext git meson ninja
run: |
meson setup builddir -Db_sanitize=none || cat builddir/meson-logs/meson-log.txt
cd builddir
meson compile -v
meson test -v --suite rmw