Skip to content

build: Retire autotools and switch to cmake, closes #21 #18

build: Retire autotools and switch to cmake, closes #21

build: Retire autotools and switch to cmake, closes #21 #18

Workflow file for this run

name: Push and PR
on:
push:
paths-ignore:
- '**.md'
- '**.txt'
- 'docs/**'
- '.*'
branches:
- master
pull_request:
paths-ignore:
- '**.md'
- '**.txt'
- 'docs/**'
- '.*'
jobs:
check:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
shell: bash
- os: macos-12
shell: bash
- os: windows-2022
msystem: 'MINGW32'
shell: msys2
- os: windows-2022
msystem: 'UCRT64'
shell: msys2
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }} {0}
steps:
- uses: actions/checkout@v4
- uses: haya14busa/action-cond@v1
id: static_flag
with:
cond: ${{ matrix.os == 'windows-2022' }}
if_true: '--enable-static'
if_false: '--disable-static'
# cmake pulls ninja by default
- name: Install dependencies (MSYS)
if: matrix.os == 'windows-2022'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
git
pacboy: >-
toolchain:p
glib2:p
cmake:p
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
run: >
sudo apt-get install -y
build-essential
cmake
ninja-build
libglib2.0-dev
libxml2-utils
- name: Install dependencies (MacOS)
if: matrix.os == 'macos-12'
run: |
brew install cmake ninja
- name: Pre-build
run: |
mkdir build
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cmake --build build -v
- name: Test prefixed install
run: |
cmake --install build --prefix inst --strip -v
- name: CTest
env:
MSYS2_PATH_TYPE: inherit
run: |
cd build && ctest --output-on-failure