Skip to content

Commit

Permalink
action: enable build on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
microcai committed Oct 28, 2024
1 parent 3e4d044 commit d97d0a2
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
#
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
os: [ubuntu-24.04, windows-latest]
os: [ubuntu-24.04, windows-latest, macos-latest]
build_type: [Release, Debug]
c_compiler: [gcc, clang, cl]
include:
Expand All @@ -36,26 +36,40 @@ jobs:
- os: ubuntu-24.04
c_compiler: clang
cpp_compiler: clang++
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-24.04
c_compiler: cl
- os: macos-latest
c_compiler: cl
- os: macos-latest
c_compiler: gcc

steps:
- uses: actions/checkout@v4
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v5
- name: compiler setup

- name: compiler setup on Linux
if: startsWith(runner.os, 'Linux')
shell: bash
run: |
echo "CC=${{ matrix.c_compiler }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cpp_compiler }}" >> $GITHUB_ENV
- name: compiler setup on Mac OS
if: startsWith(runner.os, 'macOS') && startsWith(matrix.c_compiler, 'clang')
shell: bash
run: |
echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV
echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV
- name: Install Qt
# You may pin to the exact commit or the version.
# uses: jurplel/install-qt-action@f03f05556819ceb3781ee2f455ec44c339d683c0
Expand Down Expand Up @@ -111,7 +125,7 @@ jobs:
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -v

- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
Expand Down

0 comments on commit d97d0a2

Please sign in to comment.