From c03cb9d9c26cc03abc16a150d90d7762603820e6 Mon Sep 17 00:00:00 2001 From: Lan Zongwei Date: Mon, 1 Sep 2025 00:58:05 +0800 Subject: [PATCH] CI: introduce osx-build github workflow (#6352). --- .github/workflows/osx-build.yml | 53 ++++++++++++++++++++++++++++ .github/workflows/reusable-build.yml | 6 +++- ci/ci-install.bash | 2 +- 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/osx-build.yml diff --git a/.github/workflows/osx-build.yml b/.github/workflows/osx-build.yml new file mode 100644 index 000000000..fabde38df --- /dev/null +++ b/.github/workflows/osx-build.yml @@ -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} diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 0a3b57d2a..ac890e786 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -13,9 +13,13 @@ on: cc: # gcc or clang required: true type: string + os-name: + required: false + type: string + default: linux env: - CI_OS_NAME: linux + CI_OS_NAME: ${{ inputs.os-name }} CI_COMMIT: ${{ github.sha }} CCACHE_COMPRESS: 1 CCACHE_DIR: ${{ github.workspace }}/.ccache diff --git a/ci/ci-install.bash b/ci/ci-install.bash index 7ecc860de..e889e40fe 100755 --- a/ci/ci-install.bash +++ b/ci/ci-install.bash @@ -70,7 +70,7 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then fi elif [ "$CI_OS_NAME" = "osx" ]; then brew update - brew install ccache perl gperftools + brew install ccache perl gperftools autoconf bison flex help2man elif [ "$CI_OS_NAME" = "freebsd" ]; then sudo pkg install -y autoconf bison ccache gmake perl5 else