Skip to content

Build system modernization #58

Build system modernization

Build system modernization #58

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
- master
- develop
- 'release/**'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build-autoconf:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install Ubuntu build deps
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y flex bison libgmp-dev libmpfr-dev
- name: Stabilize generated configure script timestamp
shell: bash
run: touch configure
- name: Configure
shell: bash
run: ./configure
- name: Build
shell: bash
run: make test -j4
- name: Check
shell: bash
run: make check
build-cmake-unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
regenerate_varimp: OFF
- os: ubuntu-latest
regenerate_varimp: ON
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install Ubuntu build deps
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y flex bison libgmp-dev libmpfr-dev
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: >
cmake $GITHUB_WORKSPACE
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DGECODE_REGENERATE_VARIMP=${{ matrix.regenerate_varimp }}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Check
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target check
build-cmake-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- name: shared
build_shared: ON
build_static: OFF
- name: static
build_shared: OFF
build_static: ON
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Create Build Environment
shell: pwsh
run: cmake -E make_directory "${{ github.workspace }}\\build"
- name: Configure CMake
shell: pwsh
run: >
cmake -S "${{ github.workspace }}" -B "${{ github.workspace }}\\build"
-G "Visual Studio 17 2022" -A x64
-DGECODE_ENABLE_QT=OFF
-DGECODE_ENABLE_GIST=OFF
-DGECODE_ENABLE_MPFR=OFF
-DGECODE_BUILD_SHARED=${{ matrix.build_shared }}
-DGECODE_BUILD_STATIC=${{ matrix.build_static }}
- name: Build
shell: pwsh
run: cmake --build "${{ github.workspace }}\\build" --config ${{ env.BUILD_TYPE }}
- name: Check
shell: pwsh
run: cmake --build "${{ github.workspace }}\\build" --config ${{ env.BUILD_TYPE }} --target check
build-autoconf-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Resolve uv path on Windows host
shell: pwsh
run: |
$uvExe = (Get-Command uv -ErrorAction Stop).Source
$uvDir = Split-Path -Parent $uvExe
"UV_WIN_DIR=$uvDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
autoconf
automake
bison
flex
gcc
make
m4
libtool
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-gmp
mingw-w64-ucrt-x86_64-mpfr
- name: Verify uv in MSYS2 shell
shell: msys2 {0}
run: |
UV_DIR="$(cygpath "$UV_WIN_DIR")"
echo "UV_DIR=$UV_DIR" >> "$GITHUB_ENV"
export PATH="$UV_DIR:$PATH"
uv --version
- name: Stabilize generated configure script timestamp
shell: msys2 {0}
run: touch configure
- name: Configure
shell: msys2 {0}
run: |
export PATH="$UV_DIR:$PATH"
CC=gcc CXX=g++ ./configure --with-host-os=Windows --disable-qt --disable-gist --disable-mpfr
- name: Build
shell: msys2 {0}
run: |
export PATH="$UV_DIR:$PATH"
make test -j4
- name: Check
shell: msys2 {0}
run: |
export PATH="$UV_DIR:$PATH"
make check