|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
| 4 | + workflow_dispatch: |
4 | 5 | push: |
5 | 6 | branches: [ master ] |
6 | 7 | pull_request: |
7 | 8 | branches: [ master ] |
8 | 9 |
|
9 | 10 | jobs: |
10 | 11 | build: |
| 12 | + runs-on: ${{ matrix.os }}-${{ matrix.osver }} |
11 | 13 |
|
12 | | - runs-on: ubuntu-latest |
13 | | - |
14 | | - name: Build with ${{ matrix.sanitizer }} sanitizer on ${{ matrix.arch }} |
| 14 | + name: "${{ matrix.os }} ${{ matrix.arch }}: ${{ matrix.compiler }} + ${{ matrix.sanitizer }}" |
15 | 15 | strategy: |
16 | 16 | fail-fast: false |
17 | 17 | matrix: |
18 | | - arch: [x86-32, x86-64] |
| 18 | + os: [ubuntu, macos] |
| 19 | + arch: [amd64, i386, aarch64, arm, riscv64] |
19 | 20 | sanitizer: [no, address, leak, memory, thread, undefined, valgrind] |
| 21 | + compiler: [gcc, clang] |
20 | 22 |
|
21 | 23 | include: |
22 | | - - sanitizer: "no" |
23 | | - deps: "" |
24 | | - configflags: "" |
25 | | - config: "" |
26 | | - build_env: "" |
27 | | - check_env: "" |
| 24 | + - os: ubuntu |
| 25 | + osver: 22.04 |
| 26 | + sys: linux-gnu |
| 27 | + - os: macos |
| 28 | + osver: 12 |
| 29 | + sys: apple-darwin21 |
| 30 | + - os: macos |
| 31 | + compiler: clang |
| 32 | + sys: apple-darwin21.6.0 |
| 33 | + |
| 34 | + - compiler: clang |
| 35 | + compiler_flags: "-fdebug-default-version=4" |
| 36 | + |
| 37 | + - arch: amd64 |
| 38 | + ccarch: x86_64 |
| 39 | + archcflags: "" |
| 40 | + cross: no |
| 41 | + - arch: i386 |
| 42 | + ccarch: x86_64 |
| 43 | + archcflags: "-m32 -msse2 -mfpmath=sse" |
| 44 | + cross: no |
| 45 | + - arch: aarch64 |
| 46 | + ccarch: aarch64 |
| 47 | + archcflags: "-Wl,--dynamic-linker=/usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1" |
| 48 | + runenv: 'LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib:$LD_LIBRARY_PATH' |
| 49 | + cross: yes |
| 50 | + - arch: arm |
| 51 | + ccarch: arm |
| 52 | + sys: linux-gnueabi |
| 53 | + archcflags: "-D_FILE_OFFSET_BITS=64 -latomic -Wl,--dynamic-linker=/usr/arm-linux-gnueabi/lib/ld-linux.so.3" |
| 54 | + runenv: 'LD_LIBRARY_PATH=/usr/arm-linux-gnueabi/lib:$LD_LIBRARY_PATH' |
| 55 | + cross: yes |
| 56 | + - arch: riscv64 |
| 57 | + ccarch: riscv64 |
| 58 | + archcflags: "-Wl,--dynamic-linker=/usr/riscv64-linux-gnu/lib/ld-linux-riscv64-lp64d.so.1" |
| 59 | + runenv: 'LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib:$LD_LIBRARY_PATH' |
| 60 | + cross: yes |
28 | 61 |
|
29 | 62 | - sanitizer: "address" |
30 | | - deps: "" |
31 | | - configflags: "-fsanitize=address -g -Og" |
32 | | - config: "" |
33 | | - build_env: "ASAN_OPTIONS=detect_leaks=0" |
34 | | - check_env: "ASAN_OPTIONS=detect_leaks=0" |
| 63 | + sanitizer_cflags: "-fsanitize=address" |
| 64 | + sanitize_env: "ASAN_OPTIONS=detect_leaks=0" |
35 | 65 |
|
36 | 66 | - sanitizer: "leak" |
37 | | - deps: "" |
38 | | - configflags: '-fsanitize=leak -g -Og' |
39 | | - config: "" |
40 | | - build_env: "LSAN_OPTIONS=fast_unwind_on_malloc=0" |
41 | | - check_env: "LSAN_OPTIONS=fast_unwind_on_malloc=0" |
| 67 | + sanitizer_cflags: "-fsanitize=leak" |
| 68 | + sanitize_env: "LSAN_OPTIONS=fast_unwind_on_malloc=0" |
42 | 69 |
|
43 | 70 | - sanitizer: "memory" |
44 | | - deps: "clang" |
45 | 71 | configenv: "CC=clang CXX=clang++" |
46 | | - configflags: "-fsanitize=memory -fsanitize-memory-track-origins=2 -g -Og" |
47 | | - config: "--without-pcaudiolib" |
48 | | - build_env: "MSAN_OPTIONS=exitcode=42" |
49 | | - check_env: "MSAN_OPTIONS=exitcode=42" |
| 72 | + sanitizer_cflags: "-fsanitize=memory -fsanitize-memory-track-origins=2" |
| 73 | + config: "--without-pcaudiolib --without-sonic" |
| 74 | + sanitize_env: "MSAN_OPTIONS=exitcode=42" |
50 | 75 |
|
51 | 76 | - sanitizer: "thread" |
52 | | - deps: "" |
53 | | - configflags: "-fsanitize=thread -g -Og" |
54 | | - config: "" |
55 | | - build_env: "" |
56 | | - check_env: "" |
| 77 | + sanitizer_cflags: "-fsanitize=thread" |
57 | 78 |
|
58 | 79 | - sanitizer: "undefined" |
59 | | - deps: "" |
60 | | - configflags: "-fsanitize=undefined -g -Og" |
61 | | - config: "" |
62 | | - build_env: "UBSAN_OPTIONS=halt_on_error=1" |
63 | | - check_env: "UBSAN_OPTIONS=halt_on_error=1" |
| 80 | + sanitizer_cflags: "-fsanitize=undefined" |
| 81 | + sanitize_env: "UBSAN_OPTIONS=halt_on_error=1" |
64 | 82 |
|
65 | 83 | - sanitizer: "valgrind" |
66 | | - deps: "libtool-bin valgrind" |
67 | | - configflags: '' |
68 | | - config: "" |
69 | | - build_env: 'VALGRIND="libtool --mode=execute valgrind --track-origins=yes --leak-check=full --error-exitcode=1" ' |
70 | | - check_env: 'VALGRIND="libtool --mode=execute valgrind --track-origins=yes --leak-check=full --error-exitcode=1" ' |
71 | | - |
72 | | - - arch: x86-32 |
73 | | - archdeps: "gcc-multilib g++-multilib libpcaudio-dev:i386 libsonic-dev:i386 libc6-dbg:i386" |
74 | | - archconfigflags: "-m32" |
75 | | - |
76 | | - - arch: x86-64 |
77 | | - archdeps: "" |
78 | | - archconfigflags: '' |
79 | | - |
| 84 | + sanitize_env: 'VALGRIND="libtool --mode=execute valgrind --track-origins=yes --leak-check=full --error-exitcode=1"' |
| 85 | + |
80 | 86 | exclude: |
81 | | - # These are not supported on 32bit |
82 | | - - arch: x86-32 |
| 87 | + - os: macos |
| 88 | + arch: i386 |
| 89 | + - os: macos |
| 90 | + arch: aarch64 |
| 91 | + - os: macos |
| 92 | + arch: arm |
| 93 | + - os: macos |
| 94 | + arch: riscv64 |
| 95 | + |
| 96 | + - os: macos |
| 97 | + sanitizer: valgrind # Not supported on macOS |
| 98 | + |
| 99 | + - compiler: gcc |
| 100 | + sanitizer: memory # Not supported by GCC |
| 101 | + |
| 102 | + - os: macos |
| 103 | + compiler: clang |
| 104 | + sanitizer: leak # Not supported by Apple Clang |
| 105 | + - os: macos |
| 106 | + compiler: clang |
| 107 | + sanitizer: memory # Not supported by Apple Clang |
| 108 | + - os: macos |
| 109 | + compiler: gcc |
| 110 | + sanitizer: thread # Failing on CI, should be supported? |
| 111 | + |
| 112 | + # Valgrind is unavailable for cross-builds |
| 113 | + - arch: aarch64 |
| 114 | + sanitizer: valgrind |
| 115 | + - arch: arm |
| 116 | + sanitizer: valgrind |
| 117 | + - arch: riscv64 |
| 118 | + sanitizer: valgrind |
| 119 | + |
| 120 | + # Leak sanitizer is unavailable for cross-builds |
| 121 | + - arch: i386 |
| 122 | + sanitizer: leak |
| 123 | + - arch: aarch64 |
| 124 | + sanitizer: leak |
| 125 | + - arch: arm |
| 126 | + sanitizer: leak |
| 127 | + - arch: riscv64 |
83 | 128 | sanitizer: leak |
84 | | - - arch: x86-32 |
| 129 | + |
| 130 | + # Thread sanitizer is partially unavailable |
| 131 | + - arch: i386 |
| 132 | + sanitizer: thread |
| 133 | + - arch: arm |
| 134 | + sanitizer: thread |
| 135 | + - arch: riscv64 |
| 136 | + sanitizer: thread |
| 137 | + - arch: aarch64 |
| 138 | + compiler: clang |
| 139 | + sanitizer: thread |
| 140 | + |
| 141 | + # Undefined sanitizer is partially unavailable |
| 142 | + - arch: riscv64 |
| 143 | + sanitizer: undefined |
| 144 | + - arch: arm |
| 145 | + compiler: clang |
| 146 | + sanitizer: undefined |
| 147 | + - arch: aarch64 |
| 148 | + compiler: clang |
| 149 | + sanitizer: undefined |
| 150 | + |
| 151 | + # Memory sanitizer is partially unavailable |
| 152 | + - arch: i386 |
| 153 | + sanitizer: memory |
| 154 | + - arch: riscv64 |
| 155 | + sanitizer: memory |
| 156 | + - arch: arm |
85 | 157 | sanitizer: memory |
86 | | - - arch: x86-32 |
| 158 | + - arch: aarch64 |
| 159 | + sanitizer: memory |
| 160 | + |
| 161 | + # Address sanitizer is partially unavailable |
| 162 | + - arch: riscv64 |
| 163 | + sanitizer: address |
| 164 | + - arch: arm |
| 165 | + compiler: clang |
| 166 | + sanitizer: address |
| 167 | + - arch: aarch64 |
| 168 | + compiler: clang |
| 169 | + sanitizer: address |
| 170 | + |
| 171 | + # Disable Thread sanitizer that runs for over 2h on aarch64 |
| 172 | + - arch: aarch64 |
87 | 173 | sanitizer: thread |
88 | 174 |
|
89 | 175 | steps: |
90 | | - - uses: actions/checkout@v2 |
91 | | - - name: enable 32bit architecture |
92 | | - run: sudo dpkg --add-architecture i386 |
93 | | - if: matrix.arch == 'x86-32' |
94 | | - - name: dependencies |
95 | | - run: sudo apt-get update && sudo apt-get install libpcaudio-dev libsonic-dev ronn kramdown ${{ matrix.deps }} ${{ matrix.archdeps }} |
| 176 | + |
| 177 | + # Linux - dependencies |
| 178 | + - name: apt-build-deps |
| 179 | + if: matrix.os == 'ubuntu' |
| 180 | + run: | |
| 181 | + [ 'x${{ matrix.cross }}' == 'xno' ] && sudo dpkg --add-architecture ${{ matrix.arch }} |
| 182 | + sudo apt-get update |
| 183 | + sudo apt-get install ronn kramdown python3 |
| 184 | + - name: apt-arch-deps |
| 185 | + if: matrix.os == 'ubuntu' && matrix.cross == 'no' |
| 186 | + run: "sudo apt-get install libtool-bin valgrind g++-12-multilib linux-libc-dev:${{ matrix.arch }} libpcaudio-dev:${{ matrix.arch }} libsonic-dev:${{ matrix.arch }} libstdc++-12-dev:${{ matrix.arch }} libc6-dbg:${{ matrix.arch }}" |
| 187 | + - name: apt-cross-deps |
| 188 | + if: matrix.cross == 'yes' |
| 189 | + run: sudo apt-get install qemu-user g++-12-${{ matrix.arch }}-${{ matrix.sys }} |
| 190 | + - name: apt-compile-clang |
| 191 | + if: matrix.os == 'ubuntu' && matrix.compiler == 'clang' |
| 192 | + run: sudo apt-get install clang |
| 193 | + |
| 194 | + # MacOS - dependencies |
| 195 | + - name: brew-deps |
| 196 | + if: matrix.os == 'macos' |
| 197 | + run: brew install libtool automake ronn OJFord/homebrew-formulae/kramdown && |
| 198 | + brew install --HEAD anarchivist/espeak-ng/waywardgeek-sonic |
| 199 | + - name: brew-compile-deps |
| 200 | + if: matrix.os == 'macos' && matrix.compiler == 'gcc' |
| 201 | + run: brew install gcc@12 |
| 202 | + |
| 203 | + # Checkout code |
| 204 | + - uses: actions/checkout@v3 |
| 205 | + |
| 206 | + # Configure |
96 | 207 | - name: autoconf |
97 | | - run: ./autogen.sh ; chmod -x INSTALL m4/*.m4 |
| 208 | + run: | |
| 209 | + ./autogen.sh |
| 210 | + chmod -x INSTALL m4/*.m4 |
| 211 | +
|
98 | 212 | - name: configure |
99 | | - run: ${{ matrix.configenv }} |
100 | | - CFLAGS="${{ matrix.configflags }} ${{ matrix.archconfigflags }}" |
101 | | - CXXFLAGS="${{ matrix.configflags }} ${{ matrix.archconfigflags }}" |
102 | | - ./configure ${{ matrix.config }} |
103 | | - - name: Store the config |
| 213 | + run: | |
| 214 | + [ 'x${{ matrix.compiler }}' = 'xgcc' ] && export CC="${{ matrix.ccarch }}-${{ matrix.sys }}-gcc-12" |
| 215 | + [ 'x${{ matrix.compiler }}' = 'xgcc' ] && export CXX="${{ matrix.ccarch }}-${{ matrix.sys }}-g++-12" |
| 216 | + [ 'x${{ matrix.compiler }}' = 'xclang' ] && export CC="clang --target=${{ matrix.ccarch }}-${{ matrix.sys }}" |
| 217 | + [ 'x${{ matrix.compiler }}' = 'xclang' ] && export CXX="clang++ --target=${{ matrix.ccarch }}-${{ matrix.sys }}" |
| 218 | + [ 'x${{ matrix.cross }}' = 'xyes' ] && export LD="${{ matrix.ccarch }}-${{ matrix.sys }}-ld" |
| 219 | + export CFLAGS="-g -Og -fno-omit-frame-pointer ${{ matrix.compiler_flags }} ${{ matrix.sanitizer_cflags }} ${{ matrix.archcflags }}" |
| 220 | + export CXXFLAGS="-g -Og -fno-omit-frame-pointer ${{ matrix.compiler_flags }} ${{ matrix.sanitizer_cflags }} ${{ matrix.archcflags }}" |
| 221 | + ./configure --host=${{ matrix.arch }}-${{ matrix.sys }} ${{ matrix.config }} |
| 222 | +
|
| 223 | + - name: config-failed-upload |
104 | 224 | if: ${{ failure() }} |
105 | | - uses: actions/upload-artifact@v2 |
| 225 | + uses: actions/upload-artifact@v3 |
106 | 226 | with: |
107 | | - name: config-${{ matrix.arch }}-${{ matrix.sanitizer }}.log |
| 227 | + name: config-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.compiler }}-${{ matrix.sanitizer }}.log |
108 | 228 | path: config.log |
109 | | - - name: make |
110 | | - run: ${{ matrix.build_env }} make |
111 | | - - name: make check |
112 | | - run: ${{ matrix.check_env }} make check |
113 | 229 |
|
114 | | - reprotest: |
115 | | - |
116 | | - runs-on: ubuntu-latest |
117 | | - name: Build with reprotest on ${{ matrix.arch }} |
118 | | - strategy: |
119 | | - fail-fast: false |
120 | | - matrix: |
121 | | - arch: [x86-32, x86-64] |
122 | | - |
123 | | - include: |
124 | | - - arch: x86-32 |
125 | | - archdeps: "gcc-multilib g++-multilib libpcaudio-dev:i386 libsonic-dev:i386 libc6-dbg:i386" |
126 | | - archconfigflags: "-m32" |
127 | | - |
128 | | - - arch: x86-64 |
129 | | - archdeps: "" |
130 | | - archconfigflags: '' |
131 | | - |
132 | | - steps: |
133 | | - - uses: actions/checkout@v2 |
134 | | - - name: enable 32bit architecture |
135 | | - run: sudo dpkg --add-architecture i386 |
136 | | - if: matrix.arch == 'x86-32' |
137 | | - - name: dependencies |
138 | | - run: sudo apt-get update && sudo apt-get install libpcaudio-dev libsonic-dev ronn kramdown reprotest ${{ matrix.archdeps }} |
139 | | - - name: autoconf |
140 | | - run: ./autogen.sh ; chmod -x INSTALL m4/*.m4 |
141 | | - - name: run |
142 | | - run: reprotest 'CFLAGS="${{ matrix.archconfigflags }}" CXXFLAGS="${{ matrix.archconfigflags }}" ./configure && make clean && make && make check && touch success' success |
| 230 | + # Build and test |
| 231 | + - name: make-binary |
| 232 | + run: make src/speak-ng src/espeak-ng |
| 233 | + - name: make-data |
| 234 | + run: ${{ matrix.sanitize_env }} ${{ matrix.runenv }} make all-am |
| 235 | + - name: test |
| 236 | + run: ${{ matrix.sanitize_env }} ${{ matrix.runenv }} make check |
0 commit comments