Browse Source

ci: cmake-based

master
Yury Popov 2 years ago
parent
commit
c162554396
No account linked to committer's email address
5 changed files with 50 additions and 36 deletions
  1. 3
    5
      .github/workflows/android.yml
  2. 12
    16
      .github/workflows/ci.yml
  3. 13
    15
      .github/workflows/dist.yml
  4. 5
    0
      CMakeLists.txt
  5. 17
    0
      cmake/package.cmake

+ 3
- 5
.github/workflows/android.yml View File

config: [debug, release] config: [debug, release]
include: include:
- config: debug - config: debug
target: assembleDebug
apkname: espeak-debug.apk apkname: espeak-debug.apk
- config: release - config: release
target: assembleRelease
apkname: espeak-release-unsigned.apk apkname: espeak-release-unsigned.apk
name: Build ${{ matrix.config }} APK name: Build ${{ matrix.config }} APK
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: autoconf
run: ./autogen.sh ; chmod -x INSTALL m4/*.m4
- name: configure
run: ./configure --with-gradle=$(pwd)/android/gradlew
- name: make - name: make
run: make apk-${{ matrix.config }}
run: cd android ; ./gradlew ${{ matrix.target }}
- name: upload - name: upload
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

+ 12
- 16
.github/workflows/ci.yml View File

- sanitizer: "memory" - sanitizer: "memory"
configenv: "CC=clang CXX=clang++" configenv: "CC=clang CXX=clang++"
sanitizer_cflags: "-fsanitize=memory -fsanitize-memory-track-origins=2" sanitizer_cflags: "-fsanitize=memory -fsanitize-memory-track-origins=2"
config: "--without-pcaudiolib --without-sonic"
config: "-DUSE_LIBPCAUDIO:BOOL=OFF -DUSE_LIBSONIC:BOOL=OFF"
sanitize_env: "MSAN_OPTIONS=exitcode=42" sanitize_env: "MSAN_OPTIONS=exitcode=42"


- sanitizer: "thread" - sanitizer: "thread"
sanitize_env: "UBSAN_OPTIONS=halt_on_error=1" sanitize_env: "UBSAN_OPTIONS=halt_on_error=1"


- sanitizer: "valgrind" - sanitizer: "valgrind"
sanitize_env: 'VALGRIND="libtool --mode=execute valgrind --track-origins=yes --leak-check=full --error-exitcode=1"'
sanitize_env: 'VALGRIND="valgrind --track-origins=yes --leak-check=full --error-exitcode=1"'
exclude: exclude:
- os: macos - os: macos
sudo apt-get install ronn kramdown python3 sudo apt-get install ronn kramdown python3
- name: apt-arch-deps - name: apt-arch-deps
if: matrix.os == 'ubuntu' && matrix.cross == 'no' if: matrix.os == 'ubuntu' && matrix.cross == 'no'
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: "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 - name: apt-cross-deps
if: matrix.cross == 'yes' if: matrix.cross == 'yes'
run: sudo apt-get install qemu-user g++-12-${{ matrix.arch }}-${{ matrix.sys }} run: sudo apt-get install qemu-user g++-12-${{ matrix.arch }}-${{ matrix.sys }}
# MacOS - dependencies # MacOS - dependencies
- name: brew-deps - name: brew-deps
if: matrix.os == 'macos' if: matrix.os == 'macos'
run: brew install libtool automake ronn OJFord/homebrew-formulae/kramdown &&
brew install --HEAD anarchivist/espeak-ng/waywardgeek-sonic
run: brew install cmake ronn OJFord/homebrew-formulae/kramdown
- name: brew-compile-deps - name: brew-compile-deps
if: matrix.os == 'macos' && matrix.compiler == 'gcc' if: matrix.os == 'macos' && matrix.compiler == 'gcc'
run: brew install gcc@12 run: brew install gcc@12
- uses: actions/checkout@v3 - uses: actions/checkout@v3


# Configure # Configure
- name: autoconf
run: |
./autogen.sh
chmod -x INSTALL m4/*.m4

- name: configure - name: configure
run: | run: |
[ 'x${{ matrix.compiler }}' = 'xgcc' ] && export CC="${{ matrix.ccarch }}-${{ matrix.sys }}-gcc-12" [ 'x${{ matrix.compiler }}' = 'xgcc' ] && export CC="${{ matrix.ccarch }}-${{ matrix.sys }}-gcc-12"
[ 'x${{ matrix.cross }}' = 'xyes' ] && export LD="${{ matrix.ccarch }}-${{ matrix.sys }}-ld" [ '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 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 }}" export CXXFLAGS="-g -Og -fno-omit-frame-pointer ${{ matrix.compiler_flags }} ${{ matrix.sanitizer_cflags }} ${{ matrix.archcflags }}"
./configure --host=${{ matrix.arch }}-${{ matrix.sys }} ${{ matrix.config }}
cmake -Bbuild ${{ matrix.config }} -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DUSE_ASYNC:BOOL=OFF


- name: config-failed-upload - name: config-failed-upload
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: config-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.compiler }}-${{ matrix.sanitizer }}.log
path: config.log
name: cmake-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.compiler }}-${{ matrix.sanitizer }}-builddir
path: build


# Build and test # Build and test
- name: make-binary - name: make-binary
run: make src/speak-ng src/espeak-ng
run: cmake --build build --target espeak-ng
- name: make-data - name: make-data
run: ${{ matrix.sanitize_env }} ${{ matrix.runenv }} make all-am
run: ${{ matrix.sanitize_env }} ${{ matrix.runenv }} cmake --build build --target data
- name: test - name: test
run: ${{ matrix.sanitize_env }} ${{ matrix.runenv }} make check
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

+ 13
- 15
.github/workflows/dist.yml View File

branches: [ master ] branches: [ master ]


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


jobs: jobs:


if: matrix.arch == 'x86-32' if: matrix.arch == 'x86-32'
- name: dependencies - name: dependencies
run: sudo apt-get update && sudo apt-get install ${{ env.deps }} reprotest ${{ matrix.archdeps }} run: sudo apt-get update && sudo apt-get install ${{ env.deps }} reprotest ${{ matrix.archdeps }}
- name: autoconf
run: ./autogen.sh ; chmod -x INSTALL m4/*.m4
- name: run - name: run
run: reprotest 'CFLAGS="${{ matrix.archconfigflags }}" CXXFLAGS="${{ matrix.archconfigflags }}" ./configure --without-gradle && make clean && make && make check && touch success' success
run: reprotest 'CFLAGS="${{ matrix.archconfigflags }}" CXXFLAGS="${{ matrix.archconfigflags }}" rm -rf build && cmake -Bbuild -DUSE_ASYNC:BOOL=OFF && cmake --build build && ctest --test-dir build -Ttest -j1 --output-on-failure && touch success' success


distcheck: distcheck:


- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: dependencies - name: dependencies
run: sudo apt-get update && sudo apt-get install ${{ env.deps }} run: sudo apt-get update && sudo apt-get install ${{ env.deps }}
- name: autoconf
run: ./autogen.sh ; chmod -x INSTALL m4/*.m4
- name: configure - name: configure
run: ./configure
run: cmake -Bbuild -DUSE_ASYNC:BOOL=OFF
- name: make - name: make
run: make
run: cmake --build build
- name: make check - name: make check
run: make check
- name: make dist
run: make dist
run: ctest --test-dir build -Ttest -j1 --output-on-failure

- name: make package_source
run: cmake --build build --target package_source
- name: unpack - name: unpack
run: mkdir unpack && tar -C unpack -xf *.tar.gz
run: mkdir unpack && tar -C unpack -xf build/espeak-ng-*-Source.tar.bz2

- name: re-configure - name: re-configure
run: cd unpack/espeak-ng-* && ./configure
run: cd unpack/espeak-ng-* && cmake -Bbuild -DUSE_ASYNC:BOOL=OFF
- name: re-make - name: re-make
run: cd unpack/espeak-ng-* && make
run: cd unpack/espeak-ng-* && cmake --build build
- name: re-make check - name: re-make check
run: cd unpack/espeak-ng-* && make check
run: cd unpack/espeak-ng-* && ctest --test-dir build -Ttest -j1 --output-on-failure

+ 5
- 0
CMakeLists.txt View File

include(cmake/config.cmake) include(cmake/config.cmake)
add_subdirectory(src) add_subdirectory(src)
include(cmake/data.cmake) include(cmake/data.cmake)

include(cmake/package.cmake)
include(CPack)

include(CTest)
add_subdirectory(tests) add_subdirectory(tests)


option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(BUILD_SHARED_LIBS "Build shared libraries" OFF)

+ 17
- 0
cmake/package.cmake View File

list(APPEND CPACK_SOURCE_IGNORE_FILES
/\.git/
/\.gitignore
/\.github/
/\.tx/
/\.travis.yml
/_layouts/
/android/
/build/
/chromium_extension/
/data/
/docs/
/emscripten/
/fastlane/
/tools/
/vim/
)

Loading…
Cancel
Save