Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake build system + msys2 windows binaries CI (fixes #11, fixes #148) #177

Closed
wants to merge 11 commits into from
22 changes: 0 additions & 22 deletions .appveyor.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2022 Sebastian Pipping <[email protected]>
# Licensed under the GPL v2 or later

version: 2
updates:

- package-ecosystem: "github-actions"
commit-message:
include: "scope"
prefix: "Actions"
directory: "/"
labels:
- "enhancement"
schedule:
interval: "weekly"
107 changes: 107 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Copyright (c) 2022 Sebastian Pipping <[email protected]>
# Licensed under the GPL v2 or later

name: Build for Linux

on:
pull_request:
push:
schedule:
- cron: '0 2 * * 5' # Every Friday at 2am

jobs:
checks:
name: Build for Linux (shared=${{ matrix.BUILD_SHARED_LIBS }}, syslibs=${{ matrix.syslibs }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
BUILD_SHARED_LIBS: ['ON', 'OFF']
syslibs: ['ON', 'OFF']
steps:

- uses: actions/[email protected]
with:
submodules: recursive

- name: Install build dependencies (but axc and libomemo)
run: |-
set -x
sudo apt-get update
sudo apt-get install --yes --no-install-recommends -V \
gcovr \
libcmocka-dev \
libgcrypt20-dev \
libglib2.0-dev \
libmxml-dev \
libpurple-dev \
libsignal-protocol-c-dev \
libsqlite3-dev \
libxml2-dev \
ninja-build

- name: Install build dependency axc system-wide
if: matrix.syslibs == 'ON'
run: |-
set -x
cd lib/axc
cmake \
-B build \
-G Ninja \
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} \
-DCMAKE_INSTALL_PREFIX=/usr
ninja -v -C build all
sudo ninja -v -C build install

- name: Install build dependency libomemo system-wide
if: matrix.syslibs == 'ON'
run: |-
set -x
cd lib/libomemo
cmake \
-B build \
-G Ninja \
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} \
-DCMAKE_INSTALL_PREFIX=/usr
ninja -v -C build all
sudo ninja -v -C build install

- name: Configure
run: |-
set -x
cmake \
-B build \
-G Ninja \
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} \
-DLURCH_WITH_SYSTEM_AXC=${{ matrix.syslibs }} \
-DLURCH_WITH_SYSTEM_OMEMO=${{ matrix.syslibs }} \
-D_LURCH_WITH_COVERAGE=ON

- name: Build
run: |-
set -x -o pipefail
ninja -v -C build all
readelf -d build/lurch.so | grep 'NEEDED\|RUNPATH' | sort

- name: Test
run: |-
set -x
CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test
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

ninja -v -C build install-home
find ~/.purple/plugins/ -not -type d | sort | xargs ls -l

- name: Store coverage HTML report
uses: actions/[email protected]
with:
name: lurch_coverage_shared_${{ matrix.BUILD_SHARED_LIBS }}_syslibs_${{ matrix.syslibs }}_${{ github.sha }}
path: build/coverage*.html
if-no-files-found: error
89 changes: 89 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# 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 }})
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
BUILD_SHARED_LIBS: ['ON', 'OFF']
defaults:
run:
shell: msys2 {0}
steps:

- uses: actions/[email protected]
with:
submodules: recursive

- name: Install build dependencies
uses: msys2/setup-msys2@v2
with:
install: |
cmake
mingw-w64-x86_64-cmocka
mingw-w64-x86_64-glib2
mingw-w64-x86_64-libgcrypt
mingw-w64-x86_64-libsignal-protocol-c
mingw-w64-x86_64-libxml2
mingw-w64-x86_64-mxml
mingw-w64-x86_64-pidgin
mingw-w64-x86_64-sqlite3
mingw-w64-x86_64-toolchain
ninja

- name: Configure
run: |-
set -x
cmake \
-B build \
-G Ninja \
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_SYSTEM_NAME=Windows -DWIN32=ON -DMINGW=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} \
-DLURCH_WITH_SYSTEM_AXC=OFF \
-DLURCH_WITH_SYSTEM_OMEMO=OFF

- name: Build
run: |-
set -x -o pipefail
ninja -v -C build all
objdump -p build/lurch*.dll | fgrep 'DLL Name' | sort -u | nl

- name: Gather transitive DLL closure
run: |-
set -x -o pipefail
DLL_HOME=/mingw64/bin/ BUILD_DIR=build/ ./copy_dll_closure.sh build/lurch*.dll build/
ls -lh build/*.dll

- name: Test (KNOWN TO FAIL)
run: |-
set -x
CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test || true # TODO fix tests

- name: Install
run: |-
set -x -o pipefail

DESTDIR="${PWD}"/ROOT ninja -v -C build install
find ROOT/ -not -type d | sort | xargs ls -l

ninja -v -C build install-home
find ~/.purple/plugins/ -not -type d | sort | xargs ls -l

- name: Store Windows binaries
uses: actions/[email protected]
with:
name: lurch_win32bin_shared_${{ matrix.BUILD_SHARED_LIBS }}_${{ github.sha }}
path: build/*.dll
if-no-files-found: error
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [UNRELEASED]
### Changed
- Migrate build system from a Makefile to CMake ([#177](https://github.com/gkdr/lurch/pull/177)) (thanks, [@hartwork](https://github.com/hartwork)!)

### Infrastructure
- Cover Linux build by GitHub Actions CI ([#177](https://github.com/gkdr/lurch/pull/177)) (thanks, [@hartwork](https://github.com/hartwork)!)
- Cover Windows build by GitHub Actions CI using msys2 ([#177](https://github.com/gkdr/lurch/pull/177)) (thanks, [@hartwork](https://github.com/hartwork)!)

## [0.7.0] - 2021-02-12
### Added
- This file.
Expand Down
Loading