Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 154 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- main
- master
- develop
- 'release/**'

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand All @@ -16,6 +23,20 @@ jobs:
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
Expand All @@ -28,24 +49,153 @@ jobs:
shell: bash
run: make check

build-cmake:
build-cmake-unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
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
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,7 @@ examples/sudoku-advanced
examples/tsp
examples/warehouses
examples/word-square

# Ignore build tree outputs (version metadata lives in top-level
# gecode-version.m4).
build/
Loading
Loading