-
Notifications
You must be signed in to change notification settings - Fork 79
130 lines (111 loc) · 4.69 KB
/
ci-linux.yml
File metadata and controls
130 lines (111 loc) · 4.69 KB
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
name: CI Linux
on:
push:
branches:
- master
paths:
- 'CMakeLists.txt'
- 'include/sys/*'
- 'src/common/*'
- 'src/linux/*'
- 'test/*'
- '.github/workflows/ci-linux.yml'
pull_request:
branches:
- master
paths:
- 'CMakeLists.txt'
- 'include/sys/*'
- 'src/common/*'
- 'src/linux/*'
- 'test/*'
- '.github/workflows/ci-linux.yml'
env:
ASAN_OPTIONS: symbolize=1 detect_leaks=1 detect_stack_use_after_return=1
LSAN_OPTIONS: fast_unwind_on_malloc=0:malloc_context_size=50
KQUEUE_DEBUG: yes
M_PERTURB: "0x42"
jobs:
linux-build-and-test:
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
env:
- { CC: gcc, OS: ubuntu-22.04, NAME: release-gcc, BUILD_TYPE: Release }
- { CC: clang, OS: ubuntu-22.04, NAME: release-clang, BUILD_TYPE: Release }
- { CC: musl-gcc, OS: ubuntu-22.04, NAME: release-musl-gcc, BUILD_TYPE: Release }
- { CC: clang, OS: ubuntu-22.04, NAME: debug-asan, BUILD_TYPE: Debug, ENABLE_ASAN: YES, ENABLE_LSAN: YES, ENABLE_UBSAN: YES }
- { CC: clang, OS: ubuntu-22.04, NAME: debug-tsan, BUILD_TYPE: Debug, ENABLE_TSAN: YES }
# Older kernel triggers a switch to posix/proc as it doesn't support pidfd.
- { CC: clang, OS: ubuntu-24.04, NAME: debug-asan-posix-proc, BUILD_TYPE: Debug, ENABLE_ASAN: YES, ENABLE_LSAN: YES, ENABLE_UBSAN: YES }
- { CC: clang, OS: ubuntu-24.04, NAME: debug-tsan-posix-proc, BUILD_TYPE: Debug, ENABLE_TSAN: YES }
runs-on: ${{ matrix.env.OS }}
env: ${{ matrix.env }}
name: "${{ matrix.env.NAME }}"
steps:
- uses: actions/checkout@v2
- name: Set environment
run: |
sudo apt-get install -y --no-install-recommends curl gpg lsb-release
MYREL="`lsb_release -c | grep ^Codename | awk '{print $2}'`"
echo "CLANG_VER=18" >> ${GITHUB_ENV}
echo "GCC_VER=13" >> ${GITHUB_ENV}
echo "MYREL=${MYREL}" >> ${GITHUB_ENV}
- name: Add llvm source
if: ${{ matrix.env.CC == 'clang' }}
uses: myci-actions/add-deb-repo@10
with:
repo: deb http://apt.llvm.org/${{ env.MYREL }}/ llvm-toolchain-${{ env.MYREL }}-${{ env.CLANG_VER }} main
repo-name: llvm-toolchain
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Add GCC source
if: ${{ matrix.env.CC == 'gcc' }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- name: Install LLVM ${{ env.CLANG_VER }}
if: ${{ matrix.env.CC == 'clang' }}
run: |
sudo apt-get install -y --no-install-recommends clang-${{ env.CLANG_VER }} llvm-${{ env.CLANG_VER }} gdb libclang-rt-${{ env.CLANG_VER }}-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ env.CLANG_VER }} 60 && sudo update-alternatives --set clang /usr/bin/clang-${{ env.CLANG_VER }}
sudo update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-${{ env.CLANG_VER }} 60 && sudo update-alternatives --set llvm-symbolizer /usr/bin/llvm-symbolizer-${{ env.CLANG_VER }}
- name: Install GCC ${{ env.GCC_VER }}
if: ${{ matrix.env.CC == 'gcc' }}
run: |
sudo apt-get install -y --no-install-recommends gcc-${{ env.GCC_VER }} gccgo-${{ env.GCC_VER }} gdb
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ env.GCC_VER }} 9999 && sudo update-alternatives --config gcc
- name: Install MUSL
if: ${{ matrix.env.CC == 'musl-gcc' }}
run: |
sudo apt-get install -y --no-install-recommends musl musl-dev musl-tools
- name: Install other build deps
run: |
sudo apt-get install -y \
build-essential \
debhelper \
devscripts \
dh-make \
fakeroot
- name: Configure build system
run: |
cmake . -G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL="ON" \
-DENABLE_TESTING="YES" \
-DENABLE_ASAN="${ENABLE_ASAN:-NO}" \
-DENABLE_LSAN="${ENABLE_LSAN:-NO}" \
-DENABLE_UBSAN="${ENABLE_UBSAN:-NO}" \
-DENABLE_TSAN="${ENABLE_TSAN:-NO}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
cat config.h
- name: Build libkqueue
run: make -j2
- name: Run tests
env:
KQUEUE_DEBUG: 1
run: test/libkqueue-test
- name: Build debian packages
run: cpack -G DEB
- name: Install debian packages
run: sudo apt-get install -y ./*.deb