CI: add test matrix

This commit is contained in:
Frederik Seiffert 2021-07-20 11:37:33 +02:00 committed by Frederik Seiffert
parent 82d3e70507
commit 2f953651a8
4 changed files with 169 additions and 109 deletions

View file

@ -1,52 +0,0 @@
#! /usr/bin/env sh
set -ex
echo "Building..."
sudo apt-get -qq update
sudo apt-get install -y cmake pkg-config libgnutls28-dev libgmp-dev libffi-dev \
libicu-dev libxml2-dev libxslt1-dev libssl-dev libavahi-client-dev zlib1g-dev \
gnutls-bin
if [ $LIBRARY_COMBO = 'gnu-gnu-gnu' ];
then
if [ $CC = 'gcc' ];
then
sudo apt-get install -y gobjc;
fi;
# sudo apt-get install -y libobjc-4.8-dev libblocksruntime-dev;
sudo apt-get install -y libobjc-8-dev libblocksruntime-dev;
else
curl -s -o - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -;
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main" && \
sudo apt-get update -qq;
sudo apt-get install -y clang-9 libkqueue-dev libpthread-workqueue-dev;
# sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 10 \
# --slave /usr/bin/clang++ clang++ /usr/bin/clang++-9;
export PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/clang-7.0.0\/bin//');
if [ "$RUNTIME_VERSION" = "gnustep-2.0" ];
then
sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 10;
fi;
fi;
# Install dependencies
./.github/scripts/dependencies.sh
# before script
export LIBRARY_PATH=$HOME/staging/lib:$HOME/staging/lib64:$LIBRARY_PATH;
export LD_LIBRARY_PATH=$HOME/staging/lib:$HOME/staging/lib64:$LD_LIBRARY_PATH;
if [ $LIBRARY_COMBO = 'ng-gnu-gnu' ];
then
export CPATH=$HOME/staging/include;
else
export CPATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/include;
fi;
export PATH=$HOME/staging/bin:$PATH;
export GNUSTEP_MAKEFILES=$HOME/staging/share/GNUstep/Makefiles;
. $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh;
# script
./configure $BASE_ABI || (cat config.log && false);
make && make install

View file

@ -2,17 +2,6 @@
set -ex
DEP_SRC=$HOME/dependency_source/
case $RUNNER_OS in
Linux)
DEP_ROOT=$HOME/staging
;;
Windows)
DEP_ROOT=/c/staging
;;
esac
install_gnustep_make() {
cd $DEP_SRC
git clone https://github.com/gnustep/tools-make.git
@ -23,24 +12,21 @@ install_gnustep_make() {
else
WITH_RUNTIME_ABI=""
fi
$mingw ./configure --prefix=$DEP_ROOT --with-library-combo=$LIBRARY_COMBO $WITH_RUNTIME_ABI
$mingw make install
echo Objective-C build flags: `$DEP_ROOT/bin/gnustep-config --objc-flags`
./configure --prefix=$DEP_ROOT --with-library-combo=$LIBRARY_COMBO $WITH_RUNTIME_ABI
make install
echo Objective-C build flags:
$DEP_ROOT/bin/gnustep-config --objc-flags
}
install_ng_runtime() {
cd $DEP_SRC
git clone https://github.com/gnustep/libobjc2.git
cd libobjc2
git submodule init
git submodule sync
git submodule update
cd ..
mkdir libobjc2/build
cd libobjc2/build
export CC="clang"
export CXX="clang++"
export CXXFLAGS="-std=c++11"
git submodule update --init
mkdir build
cd build
cmake \
-DTESTS=off \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
@ -53,18 +39,15 @@ install_ng_runtime() {
install_libdispatch() {
cd $DEP_SRC
# will reference upstream after https://github.com/apple/swift-corelibs-libdispatch/pull/534 is merged
git clone -b system-blocksruntime https://github.com/ngrewe/swift-corelibs-libdispatch.git
mkdir swift-corelibs-libdispatch/build
cd swift-corelibs-libdispatch/build
export CC="clang"
export CXX="clang++"
export LIBRARY_PATH=$DEP_ROOT/lib;
export LD_LIBRARY_PATH=$DEP_ROOT/lib:$LD_LIBRARY_PATH;
export CPATH=$DEP_ROOT/include;
git clone -b system-blocksruntime https://github.com/ngrewe/swift-corelibs-libdispatch.git libdispatch
mkdir libdispatch/build
cd libdispatch/build
# -Wno-error=void-pointer-to-int-cast to work around build error in queue.c due to -Werror
cmake \
-DBUILD_TESTING=off \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX:PATH=$DEP_ROOT \
-DCMAKE_C_FLAGS="-Wno-error=void-pointer-to-int-cast" \
-DINSTALL_PRIVATE_HEADERS=1 \
-DBlocksRuntime_INCLUDE_DIR=$DEP_ROOT/include \
-DBlocksRuntime_LIBRARIES=$DEP_ROOT/lib/libobjc.so \
@ -73,6 +56,7 @@ install_libdispatch() {
}
mkdir -p $DEP_SRC
if [ "$LIBRARY_COMBO" = 'ng-gnu-gnu' ]
then
install_ng_runtime

View file

@ -1,8 +0,0 @@
#! /usr/bin/env sh
set -ex
echo "Running unit tests"
. $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh;
make check || (cat Tests/tests.log && false);

View file

@ -1,30 +1,166 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on: push
on: [push, pull_request, workflow_dispatch]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
ci:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
library-combo: gnu-gnu-gnu
CC: gcc
CXX: g++
- name: Ubuntu Clang gnustep-1.9
library-combo: ng-gnu-gnu
runtime-version: gnustep-1.9
CC: clang
CXX: clang++
- name: Ubuntu Clang gnustep-1.9 disable-mixedabi
library-combo: ng-gnu-gnu
runtime-version: gnustep-1.9
configure-opts: --disable-mixedabi
CC: clang
CXX: clang++
- name: Ubuntu Clang gnustep-2.0
library-combo: ng-gnu-gnu
runtime-version: gnustep-2.0
CC: clang
CXX: clang++
- name: Ubuntu Clang gnustep-2.0 disable-mixedabi
library-combo: ng-gnu-gnu
runtime-version: gnustep-2.0
configure-opts: --disable-mixedabi
CC: clang
CXX: clang++
- name: Windows GCC MinGW-w64 i686
allow-test-failures: true
library-combo: gnu-gnu-gnu
configure-opts: --without-unwind
os: windows-latest
arch: i686
msystem: mingw32
shell: msys2 {0}
CC: gcc
CXX: g++
- name: Windows GCC MinGW-w64 x86_64
allow-test-failures: true
library-combo: gnu-gnu-gnu
configure-opts: --without-unwind
os: windows-latest
arch: x86_64
msystem: mingw64
shell: msys2 {0}
CC: gcc
CXX: g++
defaults:
run:
shell: ${{ matrix.shell || 'bash' }}
env:
LIBRARY_COMBO: gnu-gnu-gnu
CC: gcc
# Steps represent a sequence of tasks that will be executed as part of the job
SRC: ${{ github.workspace }}/source
DEP_SRC: ${{ github.workspace }}/dependency_source
DEP_ROOT: ${{ github.workspace }}/staging
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
LIBRARY_COMBO: ${{ matrix.library-combo }}
RUNTIME_VERSION: ${{ matrix.runtime-version }}
CONFIGURE_OPTS: ${{ matrix.configure-opts }}
# MSYS2: disable conversion to native-form paths when configuring GNUstep Make
# https://www.msys2.org/wiki/Porting/#filesystem-namespaces
MSYS2_ARG_CONV_EXCL: --prefix=
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
path: ${{ env.SRC }}
- name: Install packages (Linux)
if: runner.os == 'Linux'
run: |
PACKAGES="cmake pkg-config libgnutls28-dev libffi-dev libicu-dev libxml2-dev libxslt1-dev libssl-dev libavahi-client-dev zlib1g-dev gnutls-bin"
case $LIBRARY_COMBO in
gnu-gnu-gnu)
# GCC Objective-C runtime
PACKAGES="$PACKAGES libobjc-9-dev libblocksruntime-dev gobjc"
;;
ng-gnu-gnu)
# packages for libdispatch
PACKAGES="$PACKAGES libkqueue-dev libpthread-workqueue-dev"
# gnustep-2.0 runtime requires ld.gold or lld
if [ "$RUNTIME_VERSION" = "gnustep-2.0" ]; then
sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 10
fi
;;
esac
sudo apt-get update
sudo apt-get install $PACKAGES
- name: Set up MSYS2 (Windows)
uses: msys2/setup-msys2@v2
if: runner.os == 'Windows'
with:
msystem: ${{ matrix.msystem }}
install: >
git
make
pkg-config
libxml2-devel
libxslt-devel
libffi-devel
libgnutls-devel
icu-devel
mingw-w64-${{matrix.arch}}-gcc-objc
mingw-w64-${{matrix.arch}}-pkg-config
mingw-w64-${{matrix.arch}}-libxml2
mingw-w64-${{matrix.arch}}-libxslt
mingw-w64-${{matrix.arch}}-libffi
mingw-w64-${{matrix.arch}}-gnutls
mingw-w64-${{matrix.arch}}-icu
- name: Set environment variables (Windows)
if: runner.os == 'Windows'
run: |
# convert Windows paths to Unix paths for MSYS2 shell
echo "SRC=`cygpath -u $SRC`" >> $GITHUB_ENV
echo "DEP_SRC=`cygpath -u $DEP_SRC`" >> $GITHUB_ENV
echo "DEP_ROOT=`cygpath -u $DEP_ROOT`" >> $GITHUB_ENV
- name: Install dependencies
run: |
$SRC/.github/scripts/dependencies.sh
# Runs a single command using the runners shell
- name: Build source
run: ./.github/scripts/build.sh
run: |
. $DEP_ROOT/share/GNUstep/Makefiles/GNUstep.sh
cd $SRC
./configure $CONFIGURE_OPTS
make && make install
# Runs a single command using the runners shell
- name: Run Tests
run: ./.github/scripts/test.sh
- name: Run tests
continue-on-error: ${{ matrix.allow-test-failures || false }}
run: |
. $DEP_ROOT/share/GNUstep/Makefiles/GNUstep.sh
cd $SRC
make check
- name: Upload logs
uses: actions/upload-artifact@v2
if: always()
with:
name: Logs - ${{ matrix.name }}
path: |
source/config.log
source/Tests/tests.log