Browse Source

ci: rework jobs, add more platforms

master
Yury Popov 2 years ago
parent
commit
54d738259b
No account linked to committer's email address
1 changed files with 179 additions and 158 deletions
  1. 179
    158
      .github/workflows/ci.yml

+ 179
- 158
.github/workflows/ci.yml View File

pull_request: pull_request:
branches: [ master ] branches: [ master ]


env:
deps: libpcaudio-dev libsonic-dev ronn kramdown python3

jobs: jobs:
build: build:
runs-on: ${{ matrix.os }}-${{ matrix.osver }}


runs-on: ${{ matrix.os }} name: "${{ matrix.os }} ${{ matrix.arch }}: ${{ matrix.compiler }} + ${{ matrix.sanitizer }}"

name: Build with ${{ matrix.sanitizer }} sanitizer on ${{ matrix.os }} ${{ matrix.arch }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu, macos]
arch: [x86-64, x86-32, arm-32, armel-32, arm-64] arch: [amd64, i386, aarch64, arm, riscv64]
sanitizer: [no, address, leak, memory, thread, undefined, valgrind] sanitizer: [no, address, leak, memory, thread, undefined, valgrind]
compiler: [gcc, clang]


include: include:
- sanitizer: "no" - os: ubuntu
deps: "" osver: 22.04
configflags: "-g -Og -fno-omit-frame-pointer" sys: linux-gnu
config: "" - os: macos
build_env: "" osver: 12
check_env: "" 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: "address"
deps: "" sanitizer_cflags: "-fsanitize=address"
configflags: "-fsanitize=address -g -Og -fno-omit-frame-pointer" sanitize_env: "ASAN_OPTIONS=detect_leaks=0"
config: ""
build_env: "ASAN_OPTIONS=detect_leaks=0"
check_env: "ASAN_OPTIONS=detect_leaks=0"


- sanitizer: "leak" - sanitizer: "leak"
deps: "" sanitizer_cflags: "-fsanitize=leak"
configflags: '-fsanitize=leak -g -Og -fno-omit-frame-pointer' sanitize_env: "LSAN_OPTIONS=fast_unwind_on_malloc=0"
config: ""
build_env: "LSAN_OPTIONS=fast_unwind_on_malloc=0"
check_env: "LSAN_OPTIONS=fast_unwind_on_malloc=0"


- sanitizer: "memory" - sanitizer: "memory"
deps: "clang"
configenv: "CC=clang CXX=clang++" configenv: "CC=clang CXX=clang++"
configflags: "-fsanitize=memory -fsanitize-memory-track-origins=2 -g -Og -fno-omit-frame-pointer" sanitizer_cflags: "-fsanitize=memory -fsanitize-memory-track-origins=2"
config: "--without-pcaudiolib --without-sonic" config: "--without-pcaudiolib --without-sonic"
build_env: "MSAN_OPTIONS=exitcode=42" sanitize_env: "MSAN_OPTIONS=exitcode=42"
check_env: "MSAN_OPTIONS=exitcode=42"


- sanitizer: "thread" - sanitizer: "thread"
deps: "" sanitizer_cflags: "-fsanitize=thread"
configflags: "-fsanitize=thread -g -Og -fno-omit-frame-pointer"
config: ""
build_env: ""
check_env: ""


- sanitizer: "undefined" - sanitizer: "undefined"
deps: "" sanitizer_cflags: "-fsanitize=undefined"
configflags: "-fsanitize=undefined -g -Og -fno-omit-frame-pointer" sanitize_env: "UBSAN_OPTIONS=halt_on_error=1"
config: ""
build_env: "UBSAN_OPTIONS=halt_on_error=1"
check_env: "UBSAN_OPTIONS=halt_on_error=1"


- sanitizer: "valgrind" - sanitizer: "valgrind"
deps: "libtool-bin valgrind" sanitize_env: 'VALGRIND="libtool --mode=execute valgrind --track-origins=yes --leak-check=full --error-exitcode=1"'
configflags: '-g -Og -fno-omit-frame-pointer'
config: ""
build_env: 'VALGRIND="libtool --mode=execute valgrind --track-origins=yes --leak-check=full --error-exitcode=1" '
check_env: 'VALGRIND="libtool --mode=execute valgrind --track-origins=yes --leak-check=full --error-exitcode=1" '

- arch: x86-32
archdeps: "gcc-multilib g++-multilib libpcaudio-dev:i386 libsonic-dev:i386 libc6-dbg:i386"
archconfigflags: "-m32"
archimage: ''

- arch: x86-64
archdeps: ""
archconfigflags: ''
archimage: ''

- arch: arm-32
archdeps: "build-essential automake autoconf libtool"
archconfigflags: "-D_FILE_OFFSET_BITS=64"
archimage: 'raspios_lite:latest'

- arch: armel-32
archdeps: "build-essential automake autoconf libtool"
archconfigflags: "-D_FILE_OFFSET_BITS=64"
archimage: 'raspi_1_bullseye:20220121'

- arch: arm-64
archdeps: "build-essential automake autoconf libtool"
archconfigflags: ""
archimage: 'raspios_lite_arm64:latest'

exclude: 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


# These are not supported on 32bit # Leak sanitizer is unavailable for cross-builds
- arch: x86-32 - arch: i386
sanitizer: leak sanitizer: leak
- arch: x86-32 - arch: aarch64
sanitizer: memory sanitizer: leak
- arch: x86-32 - 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 sanitizer: thread


# 32-bit macOS is not supported # Undefined sanitizer is partially unavailable
- os: macos-latest - arch: riscv64
arch: x86-32 sanitizer: undefined

- arch: arm
# arm macOS is not supported compiler: clang
- os: macos-latest sanitizer: undefined
arch: arm-32 - arch: aarch64
- os: macos-latest compiler: clang
arch: armel-32 sanitizer: undefined
- os: macos-latest # Memory sanitizer is partially unavailable
arch: arm-64 - arch: i386

# These are not supported on macos
- os: macos-latest
sanitizer: leak
- os: macos-latest
sanitizer: memory sanitizer: memory
- os: macos-latest - arch: riscv64
sanitizer: valgrind

# These are not supported on arm
- arch: arm-32
sanitizer: memory sanitizer: memory
- arch: armel-32 - arch: arm
sanitizer: memory sanitizer: memory
- arch: arm-64 - arch: aarch64
sanitizer: memory sanitizer: memory
- arch: arm-32
sanitizer: thread
- arch: armel-32
sanitizer: thread
- arch: arm-64
sanitizer: thread
- arch: armel-32
sanitizer: valgrind


# These are not supported under qemu-user # Address sanitizer is partially unavailable
- arch: arm-32 - arch: riscv64
sanitizer: address sanitizer: address
- arch: arm-32 - arch: arm
sanitizer: leak compiler: clang
- arch: arm-32
sanitizer: valgrind
- arch: armel-32
sanitizer: address sanitizer: address
- arch: armel-32 - arch: aarch64
sanitizer: leak compiler: clang
- arch: arm-64
sanitizer: address sanitizer: address
- arch: arm-64
sanitizer: leak
- arch: arm-64
sanitizer: valgrind


steps: steps:
- uses: actions/checkout@v3 # Linux - dependencies
- name: enable 32bit architecture - name: apt-build-deps
run: sudo dpkg --add-architecture i386 if: matrix.os == 'ubuntu'
if: matrix.arch == 'x86-32' run: |

[ 'x${{ matrix.cross }}' == 'xno' ] && sudo dpkg --add-architecture ${{ matrix.arch }}
- name: dependencies-apt sudo apt-get update
if: matrix.os == 'ubuntu-latest' && matrix.arch != 'arm-32' && matrix.arch != 'armel-32' && matrix.arch != 'arm-64' sudo apt-get install ronn kramdown python3
run: sudo apt-get update && sudo apt-get install ${{ env.deps }} ${{ matrix.deps }} ${{ matrix.archdeps }} - name: apt-arch-deps
- name: dependencies-brew if: matrix.os == 'ubuntu' && matrix.cross == 'no'
if: matrix.os == 'macos-latest' && matrix.arch != 'arm-32' && matrix.arch != 'armel-32' && matrix.arch != 'arm-64' 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 }}"
run: brew install libtool automake ronn OJFord/homebrew-formulae/kramdown ${{ matrix.archdeps }} ; - 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 libtool automake ronn OJFord/homebrew-formulae/kramdown &&
brew install --HEAD anarchivist/espeak-ng/waywardgeek-sonic brew install --HEAD anarchivist/espeak-ng/waywardgeek-sonic
- name: brew-compile-deps
if: matrix.os == 'macos' && matrix.compiler == 'gcc'
run: brew install gcc@12

# Checkout code
- uses: actions/checkout@v3

# Configure
- name: autoconf - name: autoconf
if: matrix.arch != 'arm-32' && matrix.arch != 'armel-32' && matrix.arch != 'arm-64' run: |
run: ./autogen.sh ; chmod -x INSTALL m4/*.m4 ./autogen.sh
chmod -x INSTALL m4/*.m4

- name: configure - name: configure
if: matrix.arch != 'arm-32' && matrix.arch != 'armel-32' && matrix.arch != 'arm-64' run: |
run: ${{ matrix.configenv }} [ 'x${{ matrix.compiler }}' = 'xgcc' ] && export CC="${{ matrix.ccarch }}-${{ matrix.sys }}-gcc-12"
CFLAGS="${{ matrix.configflags }} ${{ matrix.archconfigflags }}" [ 'x${{ matrix.compiler }}' = 'xgcc' ] && export CXX="${{ matrix.ccarch }}-${{ matrix.sys }}-g++-12"
CXXFLAGS="${{ matrix.configflags }} ${{ matrix.archconfigflags }}" [ 'x${{ matrix.compiler }}' = 'xclang' ] && export CC="clang --target=${{ matrix.ccarch }}-${{ matrix.sys }}"
./configure ${{ matrix.config }} [ 'x${{ matrix.compiler }}' = 'xclang' ] && export CXX="clang++ --target=${{ matrix.ccarch }}-${{ matrix.sys }}"
- name: Store the config [ 'x${{ matrix.cross }}' = 'xyes' ] && export LD="${{ matrix.ccarch }}-${{ matrix.sys }}-ld"
if: ${{ failure() }} && matrix.arch != 'arm-32' && matrix.arch != 'armel-32' && matrix.arch != 'arm-64' 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 }}"
./configure --host=${{ matrix.arch }}-${{ matrix.sys }} ${{ matrix.config }}

- name: config-failed-upload
if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: config-${{ matrix.arch }}-${{ matrix.sanitizer }}.log name: config-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.compiler }}-${{ matrix.sanitizer }}.log
path: config.log path: config.log
- name: make # Build and test
if: matrix.arch != 'arm-32' && matrix.arch != 'armel-32' && matrix.arch != 'arm-64' - name: make-binary
run: ${{ matrix.build_env }} make run: make src/speak-ng src/espeak-ng
- name: make check - name: make-data
if: matrix.arch != 'arm-32' && matrix.arch != 'armel-32' && matrix.arch != 'arm-64' run: ${{ matrix.sanitize_env }} ${{ matrix.runenv }} make all-am
run: ${{ matrix.check_env }} make check - name: test

run: ${{ matrix.sanitize_env }} ${{ matrix.runenv }} make check
- uses: pguyot/arm-runner-action@v2
if: matrix.arch == 'arm-32' || matrix.arch == 'armel-32' || matrix.arch == 'arm-64'
with:
image_additional_mb: 4096
base_image: ${{ matrix.archimage }}
commands: |
apt-get update && apt-get install -y ${{ env.deps }} ${{ matrix.deps }} ${{ matrix.archdeps }}
./autogen.sh ; chmod -x INSTALL m4/*.m4
CFLAGS="${{ matrix.configflags }} ${{ matrix.archconfigflags }}" CXXFLAGS="${{ matrix.configflags }} ${{ matrix.archconfigflags }}" ./configure ${{ matrix.config }}
${{ matrix.build_env }} make
${{ matrix.check_env }} make check

Loading…
Cancel
Save