mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
233 lines
8.0 KiB
YAML
233 lines
8.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}-${{ matrix.osver }}
|
|
|
|
name: "${{ matrix.os }} ${{ matrix.arch }}: ${{ matrix.compiler }} + ${{ matrix.sanitizer }}"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu, macos]
|
|
arch: [amd64, i386, aarch64, arm, riscv64]
|
|
sanitizer: [no, address, leak, memory, thread, undefined, valgrind]
|
|
compiler: [gcc, clang]
|
|
|
|
include:
|
|
- os: ubuntu
|
|
osver: 22.04
|
|
sys: linux-gnu
|
|
- os: macos
|
|
osver: 12
|
|
sys: apple-darwin21
|
|
- os: macos
|
|
compiler: clang
|
|
sys: apple-darwin21.6.0
|
|
|
|
- compiler: clang
|
|
compiler_flags: "-fdebug-default-version=4"
|
|
|
|
- arch: amd64
|
|
ccarch: x86_64
|
|
archcflags: ""
|
|
cross: no
|
|
- arch: i386
|
|
ccarch: x86_64
|
|
archcflags: "-m32 -msse2 -mfpmath=sse"
|
|
cross: no
|
|
- arch: aarch64
|
|
ccarch: aarch64
|
|
archcflags: "-Wl,--dynamic-linker=/usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1"
|
|
runenv: 'LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib:$LD_LIBRARY_PATH'
|
|
cross: yes
|
|
- arch: arm
|
|
ccarch: arm
|
|
sys: linux-gnueabi
|
|
archcflags: "-D_FILE_OFFSET_BITS=64 -latomic -Wl,--dynamic-linker=/usr/arm-linux-gnueabi/lib/ld-linux.so.3"
|
|
runenv: 'LD_LIBRARY_PATH=/usr/arm-linux-gnueabi/lib:$LD_LIBRARY_PATH'
|
|
cross: yes
|
|
- arch: riscv64
|
|
ccarch: riscv64
|
|
archcflags: "-Wl,--dynamic-linker=/usr/riscv64-linux-gnu/lib/ld-linux-riscv64-lp64d.so.1"
|
|
runenv: 'LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib:$LD_LIBRARY_PATH'
|
|
cross: yes
|
|
|
|
- sanitizer: "address"
|
|
sanitizer_cflags: "-fsanitize=address"
|
|
sanitize_env: "ASAN_OPTIONS=detect_leaks=0"
|
|
|
|
- sanitizer: "leak"
|
|
sanitizer_cflags: "-fsanitize=leak"
|
|
sanitize_env: "LSAN_OPTIONS=fast_unwind_on_malloc=0"
|
|
|
|
- sanitizer: "memory"
|
|
configenv: "CC=clang CXX=clang++"
|
|
sanitizer_cflags: "-fsanitize=memory -fsanitize-memory-track-origins=2"
|
|
config: "-DUSE_LIBPCAUDIO:BOOL=OFF -DUSE_LIBSONIC:BOOL=OFF"
|
|
sanitize_env: "MSAN_OPTIONS=exitcode=42"
|
|
|
|
- sanitizer: "thread"
|
|
sanitizer_cflags: "-fsanitize=thread"
|
|
|
|
- sanitizer: "undefined"
|
|
sanitizer_cflags: "-fsanitize=undefined"
|
|
sanitize_env: "UBSAN_OPTIONS=halt_on_error=1"
|
|
|
|
- sanitizer: "valgrind"
|
|
sanitize_env: 'VALGRIND="valgrind --track-origins=yes --leak-check=full --error-exitcode=1"'
|
|
|
|
exclude:
|
|
- os: macos
|
|
arch: i386
|
|
- os: macos
|
|
arch: aarch64
|
|
- os: macos
|
|
arch: arm
|
|
- os: macos
|
|
arch: riscv64
|
|
|
|
- os: macos
|
|
sanitizer: valgrind # Not supported on macOS
|
|
|
|
- compiler: gcc
|
|
sanitizer: memory # Not supported by GCC
|
|
|
|
- os: macos
|
|
compiler: clang
|
|
sanitizer: leak # Not supported by Apple Clang
|
|
- os: macos
|
|
compiler: clang
|
|
sanitizer: memory # Not supported by Apple Clang
|
|
- os: macos
|
|
compiler: gcc
|
|
sanitizer: thread # Failing on CI, should be supported?
|
|
|
|
# Valgrind is unavailable for cross-builds
|
|
- arch: aarch64
|
|
sanitizer: valgrind
|
|
- arch: arm
|
|
sanitizer: valgrind
|
|
- arch: riscv64
|
|
sanitizer: valgrind
|
|
|
|
# Leak sanitizer is unavailable for cross-builds
|
|
- arch: i386
|
|
sanitizer: leak
|
|
- arch: aarch64
|
|
sanitizer: leak
|
|
- arch: arm
|
|
sanitizer: leak
|
|
- arch: riscv64
|
|
sanitizer: leak
|
|
|
|
# Thread sanitizer is partially unavailable
|
|
- arch: i386
|
|
sanitizer: thread
|
|
- arch: arm
|
|
sanitizer: thread
|
|
- arch: riscv64
|
|
sanitizer: thread
|
|
- arch: aarch64
|
|
compiler: clang
|
|
sanitizer: thread
|
|
|
|
# Undefined sanitizer is partially unavailable
|
|
- arch: riscv64
|
|
sanitizer: undefined
|
|
- arch: arm
|
|
compiler: clang
|
|
sanitizer: undefined
|
|
- arch: aarch64
|
|
compiler: clang
|
|
sanitizer: undefined
|
|
|
|
# Memory sanitizer is partially unavailable
|
|
- arch: i386
|
|
sanitizer: memory
|
|
- arch: riscv64
|
|
sanitizer: memory
|
|
- arch: arm
|
|
sanitizer: memory
|
|
- arch: aarch64
|
|
sanitizer: memory
|
|
|
|
# Address sanitizer is partially unavailable
|
|
- arch: riscv64
|
|
sanitizer: address
|
|
- arch: arm
|
|
compiler: clang
|
|
sanitizer: address
|
|
- arch: aarch64
|
|
compiler: clang
|
|
sanitizer: address
|
|
|
|
# Disable Thread sanitizer that runs for over 2h on aarch64
|
|
- arch: aarch64
|
|
sanitizer: thread
|
|
|
|
steps:
|
|
|
|
# Linux - dependencies
|
|
- name: apt-build-deps
|
|
if: matrix.os == 'ubuntu'
|
|
run: |
|
|
[ 'x${{ matrix.cross }}' == 'xno' ] && sudo dpkg --add-architecture ${{ matrix.arch }}
|
|
sudo apt-get update
|
|
sudo apt-get install ronn kramdown python3
|
|
- name: apt-arch-deps
|
|
if: matrix.os == 'ubuntu' && matrix.cross == 'no'
|
|
run: "sudo apt-get install cmake 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 }}"
|
|
- name: apt-cross-deps
|
|
if: matrix.cross == 'yes'
|
|
run: sudo apt-get install qemu-user g++-12-${{ matrix.arch }}-${{ matrix.sys }}
|
|
- name: apt-compile-clang
|
|
if: matrix.os == 'ubuntu' && matrix.compiler == 'clang'
|
|
run: sudo apt-get install clang
|
|
|
|
# MacOS - dependencies
|
|
- name: brew-deps
|
|
if: matrix.os == 'macos'
|
|
run: brew install cmake ronn OJFord/homebrew-formulae/kramdown
|
|
- name: brew-compile-deps
|
|
if: matrix.os == 'macos' && matrix.compiler == 'gcc'
|
|
run: brew install gcc@12
|
|
|
|
# Checkout code
|
|
- uses: actions/checkout@v3
|
|
|
|
# Configure
|
|
- name: configure
|
|
run: |
|
|
[ 'x${{ matrix.compiler }}' = 'xgcc' ] && export CC="${{ matrix.ccarch }}-${{ matrix.sys }}-gcc-12"
|
|
[ 'x${{ matrix.compiler }}' = 'xgcc' ] && export CXX="${{ matrix.ccarch }}-${{ matrix.sys }}-g++-12"
|
|
[ 'x${{ matrix.compiler }}' = 'xclang' ] && export CC="clang --target=${{ matrix.ccarch }}-${{ matrix.sys }}"
|
|
[ 'x${{ matrix.compiler }}' = 'xclang' ] && export CXX="clang++ --target=${{ matrix.ccarch }}-${{ matrix.sys }}"
|
|
[ 'x${{ matrix.cross }}' = 'xyes' ] && export LD="${{ matrix.ccarch }}-${{ matrix.sys }}-ld"
|
|
export CFLAGS="-g -Og -fno-omit-frame-pointer ${{ matrix.compiler_flags }} ${{ matrix.sanitizer_cflags }} ${{ matrix.archcflags }}"
|
|
export CXXFLAGS="-g -Og -fno-omit-frame-pointer ${{ matrix.compiler_flags }} ${{ matrix.sanitizer_cflags }} ${{ matrix.archcflags }}"
|
|
cmake -Bbuild ${{ matrix.config }} -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DUSE_ASYNC:BOOL=OFF
|
|
|
|
- name: config-failed-upload
|
|
if: ${{ failure() }}
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: cmake-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.compiler }}-${{ matrix.sanitizer }}-builddir
|
|
path: build
|
|
|
|
# Build and test
|
|
- name: make-binary
|
|
run: cmake --build build --target espeak-ng
|
|
- name: make-data
|
|
run: ${{ matrix.sanitize_env }} ${{ matrix.runenv }} cmake --build build --target data
|
|
- name: test
|
|
run: |
|
|
${{ matrix.sanitize_env }} ${{ matrix.runenv }} cmake --build build --target tests
|
|
${{ matrix.sanitize_env }} ${{ matrix.runenv }} ctest --test-dir build -Ttest -j1 --output-on-failure
|