Test build for upcoming libvips 8.15.0 #510
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ '**' ] | |
tags: [ 'v*.*.*' ] | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
force-rebuild: | |
type: boolean | |
required: false | |
description: Force rebuild | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
outputs: | |
cache-key: ${{ steps.gen-cache-key.outputs.key }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: gen-cache-key | |
run: | | |
if [ "${{ inputs.force-rebuild }}" = true ]; then | |
key=$(date +%s) | |
else | |
key=${{ hashFiles('lib/**', 'src/**', 'build.sh', 'Dockerfile') }} | |
fi | |
echo "key=$key" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
id: cache | |
with: | |
path: lib | |
key: ${{ steps.gen-cache-key.outputs.key }} | |
- name: Build | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
docker build -t wasm-vips . | |
docker run --rm -v ${{ github.workspace }}:/src wasm-vips | |
CI: | |
runs-on: ${{ matrix.os }} | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
nodejs_version: 16 | |
publish: true | |
- os: macos-11 | |
nodejs_version: 16 | |
- os: windows-2022 | |
nodejs_version: 16 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.nodejs_version }} | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/cache@v3 | |
with: | |
path: lib | |
key: ${{ needs.build.outputs.cache-key }} | |
enableCrossOsArchive: true | |
fail-on-cache-miss: true | |
- name: Install dependencies | |
run: npm install | |
- name: Install test dependencies | |
run: npm --prefix test/unit install | |
- name: Test | |
run: npm test | |
- name: Publish | |
if: matrix.publish && github.ref_type == 'tag' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npm publish | |
gh release create ${{ github.ref_name }} |