-
Notifications
You must be signed in to change notification settings - Fork 30
124 lines (106 loc) · 3.69 KB
/
Copy pathlinux.yml
File metadata and controls
124 lines (106 loc) · 3.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
# Copyright (c) 2024 Sebastian Pipping <[email protected]>
# Licensed under GNU LGPL v2.1 or later
name: Build on Linux
on:
pull_request:
push:
schedule:
- cron: '0 3 * * 5' # Every Friday at 3am
workflow_dispatch:
# Minimum permissions for security
permissions:
contents: read
jobs:
linux:
name: Build (${{ matrix.cxx }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- cc: gcc-14
cxx: g++-14
clang_major_version: null
upload: true
- cc: clang-18
cxx: clang++-18
clang_major_version: 18
steps:
- name: Checkout Git branch
uses: actions/checkout@v7
- name: Install build dependencies
run: |-
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
abi-compliance-checker \
doxygen \
lzip
- name: Install build dependency Clang ${{ matrix.clang_major_version }}
if: "${{ contains(matrix.cxx, 'clang') }}"
run: |-
sudo apt-get install --yes --no-install-recommends -V \
clang-${{ matrix.clang_major_version }} \
libclang-rt-${{ matrix.clang_major_version }}-dev
- name: 'autoreconf'
run: |-
set -x
./autogen.sh
- 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
# https://github.com/actions/runner-images/issues/9524#issuecomment-2002475952
run: |-
sudo sysctl vm.mmap_rnd_bits=28
- name: './configure'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CXXFLAGS: -std=c++11 -Wall -Wextra -pedantic -Werror -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-common
LDFLAGS: -Wl,--as-needed -g -fsanitize=address,undefined
run: |-
set -x
mkdir build
cd build
../configure --enable-doc
- name: 'make all'
run: |-
set -x
make -C build -j$(nproc) all
# and a smoke test ..
cd build
./test/mytest # i.e. ensure that the example exits with code 0
./test/mytest --compiler
./test/mytest --html
./test/mytest --text-terse
./test/mytest --text-verbose
- name: 'make distcheck'
run: |-
set -x
make -C build distcheck # without sanitizers
ls -lh build/cpptest-*.tar.*
- name: 'Upload "make dist" artifacts'
if: "${{ matrix.upload }}"
uses: actions/upload-artifact@v7
with:
name: cpptest-${{ github.sha }}-release-tarball
path: build/cpptest-*.tar.bz2
if-no-files-found: error
- name: 'make install'
run: |-
set -x -o pipefail
make -C build install DESTDIR="${PWD}"/ROOT/
find ROOT/ | sort | xargs ls -ld
- name: 'make uninstall'
run: |-
set -x
make -C build uninstall DESTDIR="${PWD}"/ROOT/
[[ "$(find ROOT/ -not -type d | tee /dev/stderr)" == '' ]] # i.e. fail CI if leftover files
- name: './check-abi.sh'
run: |-
set -x
# Make "git describe --tags" work (even for forks)
git remote get-url origin | grep -q https://github.com/cpptest/cpptest \
|| git remote set-url origin https://github.com/cpptest/cpptest
git fetch --force --tags --unshallow origin
./check-abi.sh