-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (110 loc) · 3.44 KB
/
build.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
name: build
on: [push, pull_request]
permissions: read-all
jobs:
build:
strategy:
matrix:
os: [ubuntu-24.04, macos-13, macos-14]
compiler: [gcc, clang]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Linux setup
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install \
g++-14 \
clang-18 \
autoconf \
automake \
autotools-dev \
libtool \
pkg-config
# https://github.com/actions/runner-images/issues/9491#issuecomment-1989718917
# 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
sudo sysctl vm.mmap_rnd_bits=28
- name: MacOS setup
if: runner.os == 'macOS'
run: |
brew install autoconf automake libtool
- name: Setup clang (Linux)
if: runner.os == 'Linux' && matrix.compiler == 'clang'
run: |
echo 'CC=clang-18' >> $GITHUB_ENV
echo 'CXX=clang++-18' >> $GITHUB_ENV
- name: Setup clang (MacOS)
if: runner.os == 'macOS' && matrix.compiler == 'clang'
run: |
echo 'CC=clang' >> $GITHUB_ENV
echo 'CXX=clang++' >> $GITHUB_ENV
- name: Setup gcc (Linux)
if: runner.os == 'Linux' && matrix.compiler == 'gcc'
run: |
echo 'CC=gcc-14' >> $GITHUB_ENV
echo 'CXX=g++-14' >> $GITHUB_ENV
- name: Setup gcc (MacOS)
if: runner.os == 'macOS' && matrix.compiler == 'gcc'
run: |
echo 'CC=gcc' >> $GITHUB_ENV
echo 'CXX=g++' >> $GITHUB_ENV
- name: Enable ASAN
if: runner.os == 'Linux'
run: |
asanflags="-fsanitize=address,undefined -fno-sanitize-recover=undefined"
LDFLAGS="$LDFLAGS $asanflags"
CFLAGS="$CFLAGS $asanflags -g3 -mavx2"
CXXFLAGS="$CXXFLAGS $asanflags -g3"
echo 'LDFLAGS='"$LDFLAGS" >> $GITHUB_ENV
echo 'CFLAGS='"$CFLAGS" >> $GITHUB_ENV
echo 'CXXFLAGS='"$CXXFLAGS" >> $GITHUB_ENV
- name: Configure autotools
run: |
autoreconf -i && ./configure --disable-dependency-tracking
- name: Build urlparse with distcheck
run: |
make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror"
build-cross:
strategy:
matrix:
host: [x86_64-w64-mingw32, i686-w64-mingw32]
runs-on: ubuntu-24.04
env:
HOST: ${{ matrix.host }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare for i386
if: matrix.host == 'i686-w64-mingw32'
run: |
sudo dpkg --add-architecture i386
- name: Linux setup
run: |
sudo apt-get update
sudo apt-get install \
gcc-mingw-w64 \
autoconf \
automake \
autotools-dev \
libtool \
pkg-config \
wine
- name: Configure autotools
run: |
autoreconf -i && \
./configure --disable-dependency-tracking --enable-werror \
--host="$HOST" LIBS="-pthread"
- name: Build urlparse
run: |
make -j$(nproc)
make -j$(nproc) check TESTS=""
- name: Run tests
run: |
export WINEPATH="/usr/${{ matrix.host }}/lib;$(winepath -w /usr/lib/x86_64-linux-gnu/wine/x86_64-windows)"
wine test.exe