diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd14b05..1b7c617 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,23 +7,9 @@ on: pull_request: jobs: - test: + build-plutobook: runs-on: ubuntu-22.04 - env: - PAGE_PRINT_PLUTOBOOK_PREFIX: ${{ github.workspace }}/tmp/plutobook-ci-install - PKG_CONFIG_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib/pkgconfig - LD_LIBRARY_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib - - strategy: - fail-fast: false - matrix: - ruby: - - "3.2" - - "3.3" - - "3.4" - - "4.0" - steps: - uses: actions/checkout@v4 @@ -37,7 +23,6 @@ jobs: ninja-build \ pipx \ python3-pip \ - poppler-utils \ libcairo2-dev \ libexpat1-dev \ libicu-dev \ @@ -47,7 +32,17 @@ jobs: pipx install meson==1.3.2 echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Cache PlutoBook install + uses: actions/cache@v4 + id: plutobook-cache + 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.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 \ @@ -64,6 +59,45 @@ jobs: meson compile -C tmp/plutobook-ci-build meson install -C tmp/plutobook-ci-build + - uses: actions/upload-artifact@v4 + with: + name: plutobook-ci-install + path: tmp/plutobook-ci-install + retention-days: 1 + + test: + needs: build-plutobook + runs-on: ubuntu-22.04 + + env: + PAGE_PRINT_PLUTOBOOK_PREFIX: ${{ github.workspace }}/tmp/plutobook-ci-install + PKG_CONFIG_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib/pkgconfig + LD_LIBRARY_PATH: ${{ github.workspace }}/tmp/plutobook-ci-install/lib + + strategy: + fail-fast: false + matrix: + ruby: + - "3.2" + - "3.3" + - "3.4" + - "4.0" + + steps: + - uses: actions/checkout@v4 + + - name: Install test dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + build-essential \ + poppler-utils + + - uses: actions/download-artifact@v4 + with: + name: plutobook-ci-install + path: tmp/plutobook-ci-install + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }}