Skip to content

Fix OSX build

Fix OSX build #156

# Copyright (c) the JPEG XL Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Workflow for building and running tests.
name: Build/Test MSYS2
on:
merge_group:
push:
branches:
- main
- v*.*.x
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build_test:
name: Windows MSYS2 / ${{ matrix.msystem }}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'CI:none') }}
runs-on: windows-latest
continue-on-error: ${{ matrix.faulty || false }}
strategy:
fail-fast: false
matrix:
include:
- msystem: mingw64
- msystem: clang64
- msystem: mingw32
disable_tests:
- ButteraugliTest.Lossless
- ButteraugliTest.Distmap
disable_benchmark: true
# "Legacy" toolchains are being "phased-out":
# https://www.msys2.org/news/#2023-12-13-starting-to-drop-some-32-bit-packages
# clang32 is already missing required "gtest" and "libavif"
# - msystem: clang32
# disable_benchmark: true
defaults:
run:
shell: msys2 {0}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout the source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
fetch-depth: 1
- uses: msys2/setup-msys2@07aeda7763550b267746a772dcea5e5ac3340b36 # v2
with:
msystem: ${{ matrix.msystem }}
update: true
path-type: inherit
install: >-
base-devel
git
procps
pacboy: >-
brotli:p
cmake:p
giflib:p
gtest:p
libavif:p
libjpeg-turbo:p
libpng:p
libwebp:p
ninja:p
toolchain:p
- name: CMake configure
run: |
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DJPEGXL_ENABLE_JNI=OFF \
-DJPEGXL_ENABLE_MANPAGES=OFF \
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
-DJPEGXL_FORCE_SYSTEM_GTEST=ON \
-B build \
-G Ninja
- name: CMake build
run: cmake --build build
- name: Test
if: |
github.event_name == 'push' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'CI:full'))
run: ctest --test-dir build --parallel 2 --output-on-failure -E "${{ join(matrix.disable_tests, '|') }}"
- name: Fast benchmark ${{ matrix.msystem }}
if: github.event_name != 'merge_group' && !(matrix.disable_benchmark || false)
run: |
systeminfo | grep -A 1 Processor
wmic cpu get Name, NumberofCores, NumberOfLogicalProcessors, MaxClockSpeed
mkdir tmp
export TMPDIR=`pwd`/tmp
export PATH=$PATH:`pwd`/build/lib
BENCHMARK_NUM_THREADS=2 STORE_IMAGES=0 ./ci.sh fast_benchmark