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

@@ -16,18 +16,16 @@ jobs:
config: [debug, release]
include:
- config: debug
target: assembleDebug
apkname: espeak-debug.apk
- config: release
target: assembleRelease
apkname: espeak-release-unsigned.apk
name: Build ${{ matrix.config }} APK
steps:
- 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
run: make apk-${{ matrix.config }}
run: cd android ; ./gradlew ${{ matrix.target }}
- name: upload
uses: actions/upload-artifact@v3
with:

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

@@ -70,7 +70,7 @@ jobs:
- sanitizer: "memory"
configenv: "CC=clang CXX=clang++"
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"

- sanitizer: "thread"
@@ -81,7 +81,7 @@ jobs:
sanitize_env: "UBSAN_OPTIONS=halt_on_error=1"

- 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:
- os: macos
@@ -183,7 +183,7 @@ jobs:
sudo apt-get install ronn kramdown python3
- name: apt-arch-deps
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
if: matrix.cross == 'yes'
run: sudo apt-get install qemu-user g++-12-${{ matrix.arch }}-${{ matrix.sys }}
@@ -194,8 +194,7 @@ jobs:
# 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
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
@@ -204,11 +203,6 @@ jobs:
- uses: actions/checkout@v3

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

- name: configure
run: |
[ 'x${{ matrix.compiler }}' = 'xgcc' ] && export CC="${{ matrix.ccarch }}-${{ matrix.sys }}-gcc-12"
@@ -218,19 +212,21 @@ jobs:
[ '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 }}"
./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
if: ${{ failure() }}
uses: actions/upload-artifact@v3
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
- name: make-binary
run: make src/speak-ng src/espeak-ng
run: cmake --build build --target espeak-ng
- 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
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

@@ -8,7 +8,7 @@ on:
branches: [ master ]

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

jobs:

@@ -37,10 +37,8 @@ jobs:
if: matrix.arch == 'x86-32'
- name: dependencies
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
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:

@@ -50,21 +48,21 @@ jobs:
- uses: actions/checkout@v3
- name: dependencies
run: sudo apt-get update && sudo apt-get install ${{ env.deps }}
- name: autoconf
run: ./autogen.sh ; chmod -x INSTALL m4/*.m4
- name: configure
run: ./configure
run: cmake -Bbuild -DUSE_ASYNC:BOOL=OFF
- name: make
run: make
run: cmake --build build
- 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
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
run: cd unpack/espeak-ng-* && ./configure
run: cd unpack/espeak-ng-* && cmake -Bbuild -DUSE_ASYNC:BOOL=OFF
- name: re-make
run: cd unpack/espeak-ng-* && make
run: cd unpack/espeak-ng-* && cmake --build build
- 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

@@ -12,6 +12,11 @@ include(cmake/deps.cmake)
include(cmake/config.cmake)
add_subdirectory(src)
include(cmake/data.cmake)

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

include(CTest)
add_subdirectory(tests)

option(BUILD_SHARED_LIBS "Build shared libraries" OFF)

+ 17
- 0
cmake/package.cmake View File

@@ -0,0 +1,17 @@
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