Skip to content

utillib

utillib #97

Workflow file for this run

# https://docs.github.com/en/actions/learn-github-actions/contexts
#---
name: utillib
on:
push:
branches:
- master
pull_request:
page_build:
workflow_dispatch:
env:
IS_RELEASE: ${{ github.event_name == 'push' && github.ref_type == 'tag' && startswith(github.ref_name, 'v') }}
# choose boost version carefully, because it might be that the version is not supported
# by the windows version (https://stackoverflow.com/questions/12484894/what-do-i-do-about-batch-recursion-exceeds-stack-limits-when-running-boost-bui)
BOOST_VERSION: 1.80.0
jobs:
build:
runs-on: ${{ matrix.env.os }}
strategy:
fail-fast: false
matrix:
env:
- name: linux
os: ubuntu-22.04
platform: linux
cmake_env: { }
# - name: macos
# os: macos-12
# platform: mac
# boost_toolset: clang
# msvc_arch:
# boost_install_path: /Users/runner/work
# cmake_env:
# BOOST_ROOT /Users/runner/work/boost
# pack: 1
# - name: win64
# os: windows-latest
# platform: win
# msvc_arch: x64
# cmake_env:
# # CMAKE_RC_FLAGS: "/C 1252"
# CC: cl
# CXX: cl
# BOOST_ROOT: D:/a/boost
# pack: 1
# - name: win32
# os: windows-latest
# platform: win
# msvc_arch: x86
# boost_toolset: mingw
# boost_install_path: D:/a/boost
# cmake_env:
# CMAKE_RC_FLAGS: "/C 1252"
# CC: clang
# CXX: clang++
# CMAKE_C_FLAGS: -m32
# CMAKE_CXX_FLAGS: -m32
# BOOST_ROOT: D:/a/boost
# pack: 1
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
with:
platform: ${{ matrix.env.ninja_platform }}
destination: ninja
- name: Setup linux environment
if: matrix.env.platform == 'linux'
run: |
sudo apt update
# flex-old contains FlexLexer.h which is needed by util
# For some reason, flex does not contain this header
sudo apt install --yes git cmake libboost-all-dev expat zlib1g libboost-all-dev autotools-dev autopoint autoconf help2man libwxgtk3.0-gtk3-dev
- name: Install flex
if: matrix.env.platform == 'linux'
run: |
# The new flex version in ubuntu does not have the needed FlexLexer.h
# but the older version has problems to create files
git clone https://github.com/westes/flex.git
cd flex
./autogen.sh
./configure
make
sudo make install
- name: Cache Boost
if: matrix.env.platform != 'linux'
uses: actions/cache@v2
with:
path: '${{ runner.workspace }}/boost_*.tar.gz'
key: 'boost-${{env.BOOST_VERSION}}'
- name: Build Boost
id: boost
if: matrix.env.platform != 'linux'
# This won't re-download the archive unnecessarily:
uses: egor-tensin/build-boost@v1
with:
version: ${{env.BOOST_VERSION}}
libraries: program_options filesystem system locale
toolset: ${{ matrix.env.boost_toolset}}
directory: ${{ matrix.env.boost_install_path }}
configuration: Release
platform: ${{ matrix.env.msvc_arch }}
static: 1
- name: Setup MSVC environment
if: matrix.env.platform == 'win'
uses: seanmiddleditch/gha-setup-vsdevenv@v3
with:
arch: ${{ matrix.env.msvc_arch }}
- name: Build Mac expat
if: matrix.env.platform == 'mac'
run: |
# https://macappstore.org/expat/
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
brew install expat
- name: Install Windows Static Expat
if: matrix.env.platform == 'win'
run: |
vcpkg install expat:x64-windows-static
- name: Install llvm
if: matrix.env.platform == 'mac'
run: brew install llvm
# https://stackoverflow.com/questions/23749530/brew-install-zlib-devel-on-mac-os-x-mavericks
- name: zlib
if: matrix.env.platform == 'mac'
run: |
wget https://www.zlib.net/zlib-1.2.12.tar.xz
tar -xvf zlib-1.2.12.tar.xz
cd zlib-1.2.12
./configure
make
make install
- name: Build Information
run: |
echo "ninja version: $(ninja --version)"
cmake --version
- name: Configure Linux Release
if: matrix.env.platform == 'linux'
env: ${{ matrix.env.cmake_env }}
run: |
mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -D UTIL_TOOLS=OFF -D UTIL_TEST=OFF ${{ env.CMAKE_FLAGS }} ${{ matrix.env.cmake_flags }} ../..
- name: Configure Windows Release
if: matrix.env.platform == 'win'
env: ${{ matrix.env.cmake_env }}
run: |
mkdir -p build/release
cd build/release
cmake -G "Visual Studio 17 2022" -A ${{ matrix.env.msvc_arch }} -DCMAKE_BUILD_TYPE=Release -D UTIL_TOOLS=OFF -D UTIL_TEST=OFF -D "BOOST_ROOT=${{ steps.boost.outputs.root }}" -D "BOOST_LIBRARYDIR=${{ steps.boost.outputs.librarydir }}" ${{ env.CMAKE_FLAGS }} ${{ matrix.env.cmake_flags }} ../..
- name: Build
run: |
cd build/release
ninja
#...