Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit 869cace

Browse files
authored
Add macOS builds and refactor CI (#8)
* Add macOS builds * Install go for macOS * Uninstall openssl on macOS * Add a flag for brew uninstall * Install ninja on macOS * Install make instead of ninja * Add make to path on macOS * Set CMAKE_MAKE_PROGRAM * Drop macOS 13 * Strip symbols on macOS * Fix strip for macOS * Strip on macos more aggresively * Remove g++ builds * Simplify matrix * Fix matrix * Refactor CI and improve artifact names
1 parent 3e1b3a2 commit 869cace

1 file changed

Lines changed: 21 additions & 28 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,18 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212

1313
strategy:
14-
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
1514
fail-fast: false
1615

1716
matrix:
18-
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025]
19-
cpp_compiler: [g++, clang++, cl]
20-
build_shared_libs: [ON]
17+
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2025, macos-26]
2118
include:
22-
- os: ubuntu-24.04
23-
cpp_compiler: g++
2419
- os: ubuntu-24.04
2520
cpp_compiler: clang++
26-
- os: ubuntu-24.04-arm
27-
cpp_compiler: g++
2821
- os: ubuntu-24.04-arm
2922
cpp_compiler: clang++
3023
- os: windows-2025
3124
cpp_compiler: cl
32-
exclude:
33-
- os: ubuntu-24.04
34-
cpp_compiler: cl
35-
- os: ubuntu-24.04-arm
36-
cpp_compiler: cl
37-
- os: windows-2025
38-
cpp_compiler: g++
39-
- os: windows-2025
25+
- os: macos-26
4026
cpp_compiler: clang++
4127

4228
steps:
@@ -45,21 +31,26 @@ jobs:
4531
submodules: recursive
4632
fetch-depth: 0
4733

48-
- name: Install Required Packages
49-
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm'
34+
- name: Setup Packages
35+
if: runner.os == 'Linux'
5036
run: |
5137
sudo apt-get update
5238
sudo apt-get install nasm
5339
40+
- name: Setup Packages
41+
if: runner.os == 'macOS'
42+
run: |
43+
brew install nasm go
44+
5445
- name: Set reusable strings
55-
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
5646
id: strings
5747
shell: bash
5848
run: |
5949
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
6050
echo "vcpkg-manifest-dir=${{ github.workspace }}/libdave/cpp/vcpkg-alts/boringssl" >> "$GITHUB_OUTPUT"
6151
echo "cmake-toolchain-file=${{ github.workspace }}/libdave/cpp/vcpkg/scripts/buildsystems/vcpkg.cmake" >> "$GITHUB_OUTPUT"
6252
echo "build-type=Release" >> "$GITHUB_OUTPUT"
53+
echo "build-shared-libs=ON" >> "$GITHUB_OUTPUT"
6354
echo "pdb=ON" >> "$GITHUB_OUTPUT"
6455
6556
- name: Configure CMake
@@ -70,12 +61,11 @@ jobs:
7061
CONFIG=${{ steps.strings.outputs.build-type }}
7162
VCPKG_MANIFEST_DIR=${{ steps.strings.outputs.vcpkg-manifest-dir }}
7263
TOOLCHAIN_FILE=${{ steps.strings.outputs.cmake-toolchain-file }}
73-
SHARED=${{ matrix.build_shared_libs }}
64+
SHARED=${{ steps.strings.outputs.build-shared-libs }}
7465
PDB=${{ steps.strings.outputs.pdb }}
7566
SOURCE_DIR=${{ github.workspace }}
7667
7768
- name: Build
78-
# 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).
7969
run: >
8070
make build
8171
CONFIG=${{ steps.strings.outputs.build-type }}
@@ -84,12 +74,10 @@ jobs:
8474
8575
- name: Test
8676
working-directory: ${{ steps.strings.outputs.build-output-dir }}
87-
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
88-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
8977
run: ctest --build-config ${{ steps.strings.outputs.build-type }}
9078

9179
- name: Move Build Output
92-
if: matrix.os == 'windows-2025'
80+
if: runner.os == 'Windows'
9381
run: |
9482
mv ${{ steps.strings.outputs.build-output-dir }}/out/${{ steps.strings.outputs.build-type }}/* ${{ steps.strings.outputs.build-output-dir }}/out/
9583
rm ${{ steps.strings.outputs.build-output-dir }}/out/${{ steps.strings.outputs.build-type }}/
@@ -101,23 +89,28 @@ jobs:
10189
- name: Upload Artifacts with Symbols
10290
uses: actions/upload-artifact@v4
10391
with:
104-
name: libdavec-${{ matrix.os }}-${{ matrix.cpp_compiler }}-shared${{ matrix.build_shared_libs }}-symbolsON
92+
name: libdavec-${{ runner.os }}-${{ runner.arch }}-symbols
10593
path: |
10694
${{ steps.strings.outputs.build-output-dir }}/out/
10795
10896
- name: Strip Symbols
109-
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm'
97+
if: runner.os == 'Linux'
11098
run: |
11199
strip ${{ steps.strings.outputs.build-output-dir }}/out/libdavec.so
112100
113101
- name: Strip Symbols
114-
if: matrix.os == 'windows-2025'
102+
if: runner.os == 'Windows'
115103
run: |
116104
rm ${{ steps.strings.outputs.build-output-dir }}/out/libdavec.pdb
117105
106+
- name: Strip Symbols
107+
if: runner.os == 'macOS'
108+
run: |
109+
strip -x ${{ steps.strings.outputs.build-output-dir }}/out/libdavec.dylib
110+
118111
- name: Upload Artifacts without Symbols
119112
uses: actions/upload-artifact@v4
120113
with:
121-
name: libdavec-${{ matrix.os }}-${{ matrix.cpp_compiler }}-shared${{ matrix.build_shared_libs }}-symbolsOFF
114+
name: libdavec-${{ runner.os }}-${{ runner.arch }}
122115
path: |
123116
${{ steps.strings.outputs.build-output-dir }}/out/

0 commit comments

Comments
 (0)