Skip to content
Merged
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
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,81 @@ jobs:
--with-plutobook-include="$PAGE_PRINT_PLUTOBOOK_PREFIX/include" \
--with-plutobook-lib="$PAGE_PRINT_PLUTOBOOK_PREFIX/lib"
bundle exec rake test

build-plutobook-macos:
runs-on: macos-14

steps:
- uses: actions/checkout@v4

- name: Install native dependencies
run: |
brew update
brew install meson ninja pkg-config cairo freetype harfbuzz fontconfig expat icu4c

- name: Configure Homebrew pkg-config paths
run: echo "PKG_CONFIG_PATH=$(brew --prefix icu4c)/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV"

- name: Cache PlutoBook install
uses: actions/cache@v4
id: plutobook-cache-macos
with:
path: tmp/plutobook-ci-install
key: plutobook-v0.17.0-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: |
plutobook-v0.17.0-${{ runner.os }}-

- name: Build PlutoBook
if: steps.plutobook-cache-macos.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch v0.17.0 https://github.com/plutoprint/plutobook.git tmp/plutobook-ci-src
meson setup tmp/plutobook-ci-build tmp/plutobook-ci-src \
--prefix="$PWD/tmp/plutobook-ci-install" \
--libdir=lib \
--buildtype=release \
-Dcurl=disabled \
-Dturbojpeg=disabled \
-Dwebp=disabled \
-Dtools=disabled \
-Dtests=disabled \
-Dexamples=disabled
meson compile -C tmp/plutobook-ci-build
meson install -C tmp/plutobook-ci-build

- uses: actions/upload-artifact@v4
with:
name: plutobook-ci-install-macos
path: tmp/plutobook-ci-install
retention-days: 1

test-macos:
needs: build-plutobook-macos
runs-on: macos-14

env:
PAGE_PRINT_PLUTOBOOK_PREFIX: ${{ github.workspace }}/tmp/plutobook-ci-install
PKG_CONFIG_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib/pkgconfig
DYLD_LIBRARY_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib

steps:
- uses: actions/checkout@v4

- name: Install test dependencies
run: brew install poppler

- uses: actions/download-artifact@v4
with:
name: plutobook-ci-install-macos
path: tmp/plutobook-ci-install

- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true

- name: Run tests
run: |
bundle exec rake compile -- \
--with-plutobook-include="$PAGE_PRINT_PLUTOBOOK_PREFIX/include" \
--with-plutobook-lib="$PAGE_PRINT_PLUTOBOOK_PREFIX/lib"
bundle exec rake test
Loading