Skip to content

Commit

Permalink
CI: Add workflow to test Meson and CMake builds
Browse files Browse the repository at this point in the history
This adds a workflow using GitHub Actions which builds WPEBackend-fdo
twice: one time with CMake, and another with Meson. Both results are
checked to ensure that both build systems produce the same set of
headers (and with the same contents), and libraries with the same public
symbols.
  • Loading branch information
aperezdc committed May 8, 2020
1 parent 0a45f5d commit 8507b52
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---

name: CI

on: [push]

jobs:
build:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Debian Packages
run: |
sudo apt update
sudo apt install -y cmake flex libjson-glib-dev libxkbcommon-dev \
libegl1-mesa-dev libxml2-dev libxslt1-dev libyaml-dev llvm-dev \
libclang-dev libglib2.0-dev libepoxy-dev ninja-build
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Python Package Cache
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install Python Packages
run: |
python -m pip install --upgrade pip setuptools wheel
HOTDOC_BUILD_C_EXTENSION=enabled pip install hotdoc meson==0.49
- name: Fetch libwpe
run: |
if [[ -d ~/libwpe/.git ]] ; then
echo 'Updating libwpe clone...'
cd ~/libwpe/
git reset --hard
git clean -qxdff
git checkout -f master
git pull -q
else
echo 'Cloning libwpe afresh...'
rm -rf ~/libwpe/
git clone -q https://github.com/WebPlatformForEmbedded/libwpe ~/libwpe/
fi
- name: Build and Install libwpe
run: |
mkdir ~/libwpe-build/ && cd "$_"
cmake ~/libwpe/ -DBUILD_DOCS=OFF \
-DCMAKE_INSTALL_PREFIX=${HOME}/libwpe-prefix \
-DCMAKE_INSTALL_LIBDIR=${HOME}/libwpe-prefix/lib
TERM=dumb cmake --build . --parallel $(nproc) --target install
- name: Meson - Configure
run: |
export PKG_CONFIG_PATH="${HOME}/libwpe-prefix/lib/pkgconfig/"
mkdir -p _work/meson
meson _work/meson/build --prefix /usr -Dbuild_docs=true
- name: Meson - Build
run: |
ninja -C _work/meson/build
- name: Meson - Install
run: |
DESTDIR="$(pwd)/_work/meson/prefix" ninja -C _work/meson/build install
nm -D -P _work/meson/build/libWPEBackend-fdo-1.0.so \
| awk '$2 == "T" || $2 == "U" {print $2 " " $1}' \
| sort -u > _work/meson/symbols
(cd _work/meson/prefix && find usr/lib -type f | sort) \
> _work/meson/files
- name: Meson - Archive Artifacts
uses: actions/upload-artifact@v1
with:
name: build-meson
path: _work/meson/prefix
- name: CMake - Configure
run: |
export PKG_CONFIG_PATH="${HOME}/libwpe-prefix/lib/pkgconfig/"
mkdir -p _work/cmake/build && cd $_
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_DOCS=OFF -DEXPORTABLE_EGL=ON ../../..
- name: CMake - Build
run: |
make -C _work/cmake/build -j$(nproc)
- name: CMake - Install
run: |
DESTDIR="$(pwd)/_work/cmake/prefix" make -C _work/cmake/build install
nm -D -P _work/cmake/build/libWPEBackend-fdo-1.0.so \
| awk '$2 == "T" || $2 == "U" {print $2 " " $1}' \
| sort -u > _work/cmake/symbols
(cd _work/cmake/prefix && find usr/lib -type f | sort) \
> _work/cmake/files
- name: CMake - Archive Artifacts
uses: actions/upload-artifact@v1
with:
name: build-cmake
path: _work/cmake/prefix
- name: Check Installations
run: |
diff -u _work/{cmake,meson}/files
diff -u _work/{cmake,meson}/symbols
diff -Naur _work/{cmake,meson}/prefix/usr/include/

0 comments on commit 8507b52

Please sign in to comment.