CI: introduce osx-build github workflow (#6352).

This commit is contained in:
Lan Zongwei 2025-09-01 00:58:05 +08:00 committed by GitHub
parent 34e3892367
commit c03cb9d9c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 59 additions and 2 deletions

53
.github/workflows/osx-build.yml vendored Normal file
View File

@ -0,0 +1,53 @@
---
# DESCRIPTION: Github actions config
# This name is key to badges in README.rst, so we use the name build
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
#
name: osx-build
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: 0 0 * * 0 # weekly
permissions:
contents: read
defaults:
run:
shell: bash
working-directory: repo
concurrency:
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build-osx-gcc:
name: Build
uses: ./.github/workflows/reusable-build.yml
with:
os: ${{ matrix.os }}
os-name: osx
cc: ${{ matrix.cc }}
strategy:
fail-fast: false
matrix:
include:
- {os: macos-15, cc: gcc}
build-osx-clang:
name: Build
uses: ./.github/workflows/reusable-build.yml
with:
os: ${{ matrix.os }}
os-name: osx
cc: ${{ matrix.cc }}
strategy:
fail-fast: false
matrix:
include:
- {os: macos-15, cc: clang}

View File

@ -13,9 +13,13 @@ on:
cc: # gcc or clang cc: # gcc or clang
required: true required: true
type: string type: string
os-name:
required: false
type: string
default: linux
env: env:
CI_OS_NAME: linux CI_OS_NAME: ${{ inputs.os-name }}
CI_COMMIT: ${{ github.sha }} CI_COMMIT: ${{ github.sha }}
CCACHE_COMPRESS: 1 CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache CCACHE_DIR: ${{ github.workspace }}/.ccache

View File

@ -70,7 +70,7 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
fi fi
elif [ "$CI_OS_NAME" = "osx" ]; then elif [ "$CI_OS_NAME" = "osx" ]; then
brew update brew update
brew install ccache perl gperftools brew install ccache perl gperftools autoconf bison flex help2man
elif [ "$CI_OS_NAME" = "freebsd" ]; then elif [ "$CI_OS_NAME" = "freebsd" ]; then
sudo pkg install -y autoconf bison ccache gmake perl5 sudo pkg install -y autoconf bison ccache gmake perl5
else else