-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from hartwork/cmake-linux-msys2
CMake build system + msys2 windows binaries CI
- Loading branch information
Showing
11 changed files
with
418 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,16 +11,18 @@ on: | |
|
||
jobs: | ||
checks: | ||
name: Build for Linux (${{ matrix.libsignal }} libsignal) | ||
name: Build for Linux (shared=${{ matrix.BUILD_SHARED_LIBS }}, pthreads=${{ matrix.AXC_WITH_PTHREADS }}) | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
libsignal: ['system', 'bundled'] | ||
BUILD_SHARED_LIBS: ['ON', 'OFF'] | ||
AXC_WITH_PTHREADS: ['ON', 'OFF'] | ||
steps: | ||
|
||
- uses: actions/[email protected] | ||
|
||
- name: Install build dependencies (all but libsignal-protocol-c) | ||
- name: Install build dependencies | ||
run: |- | ||
set -x | ||
sudo apt-get update | ||
|
@@ -29,37 +31,41 @@ jobs: | |
libcmocka-dev \ | ||
libgcrypt20-dev \ | ||
libglib2.0-dev \ | ||
libsqlite3-dev | ||
libsignal-protocol-c-dev \ | ||
libsqlite3-dev \ | ||
ninja-build | ||
- name: Install build dependency libsignal-protocol-c | ||
if: ${{ matrix.libsignal == 'system' }} | ||
- name: Configure | ||
run: |- | ||
sudo apt-get install --yes --no-install-recommends -V \ | ||
libsignal-protocol-c-dev | ||
- name: Fetch Git submodule for build dependency libsignal-protocol-c | ||
if: ${{ matrix.libsignal == 'bundled' }} | ||
run: |- | ||
git submodule update --init --recursive | ||
set -x | ||
cmake \ | ||
-B build \ | ||
-G Ninja \ | ||
-DAXC_WITH_PTHREADS=${{ matrix.AXC_WITH_PTHREADS }} \ | ||
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} \ | ||
-D_AXC_WITH_COVERAGE=ON | ||
- name: Build | ||
run: |- | ||
set -x | ||
make -j $(nproc) all build/libaxc-nt.a | ||
ninja -v -C build all | ||
cat build/libaxc.pc | ||
- name: Test | ||
run: |- | ||
make coverage # includes tests | ||
set -x | ||
CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test | ||
ninja -C build coverage | ||
- name: Install | ||
run: |- | ||
set -x -o pipefail | ||
make DESTDIR="${PWD}"/ROOT install | ||
DESTDIR="${PWD}"/ROOT ninja -v -C build install | ||
find ROOT/ -not -type d | sort | xargs ls -l | ||
- name: Store coverage HTML report | ||
uses: actions/[email protected] | ||
with: | ||
name: coverage_${{ matrix.libsignal }} | ||
path: coverage/ | ||
name: axc_coverage_shared_${{ matrix.BUILD_SHARED_LIBS }}_pthreads_${{ matrix.AXC_WITH_PTHREADS }} | ||
path: build/coverage*.html | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Copyright (c) 2022 Sebastian Pipping <[email protected]> | ||
# Licensed under the GPL v2 or later | ||
|
||
name: Build for Windows | ||
|
||
on: | ||
pull_request: | ||
push: | ||
schedule: | ||
- cron: '0 2 * * 5' # Every Friday at 2am | ||
|
||
jobs: | ||
checks: | ||
name: Build for Windows (shared=${{ matrix.BUILD_SHARED_LIBS }}, pthreads=${{ matrix.AXC_WITH_PTHREADS }}) | ||
runs-on: windows-2019 | ||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
BUILD_SHARED_LIBS: ['ON', 'OFF'] | ||
AXC_WITH_PTHREADS: ['ON', 'OFF'] | ||
steps: | ||
|
||
- uses: actions/[email protected] | ||
|
||
- name: Install build dependencies | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: MINGW32 | ||
install: | | ||
cmake | ||
mingw-w64-i686-cmocka | ||
mingw-w64-i686-glib2 | ||
mingw-w64-i686-libgcrypt | ||
mingw-w64-i686-libsignal-protocol-c | ||
mingw-w64-i686-sqlite3 | ||
mingw-w64-i686-toolchain | ||
ninja | ||
- name: Configure | ||
run: |- | ||
set -x | ||
cmake \ | ||
-B build \ | ||
-G Ninja \ | ||
-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_SYSTEM_NAME=Windows -DWIN32=ON -DMINGW=ON \ | ||
-DAXC_WITH_PTHREADS=${{ matrix.AXC_WITH_PTHREADS }} \ | ||
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} \ | ||
-D_AXC_WITH_COVERAGE=ON | ||
- name: Build | ||
run: |- | ||
set -x | ||
ninja -v -C build all | ||
cat build/libaxc.pc | ||
- name: Test (KNOWN TO FAIL) | ||
run: |- | ||
set -x | ||
CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test || true # TODO fix tests | ||
# Note: msys2 does not come with a package for gcovr, yet(?) | ||
# ninja -C build coverage | ||
- name: Install | ||
run: |- | ||
set -x -o pipefail | ||
DESTDIR="${PWD}"/ROOT ninja -v -C build install | ||
find ROOT/ -not -type d | sort | xargs ls -l | ||
- name: Store Windows binaries | ||
uses: actions/[email protected] | ||
with: | ||
name: axc_win32bin_shared_${{ matrix.BUILD_SHARED_LIBS }}_pthreads_${{ matrix.AXC_WITH_PTHREADS }} | ||
path: | | ||
build/*.a | ||
build/*.dll | ||
build/*.exe | ||
if-no-files-found: error |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.