Skip to content

Commit d128e8a

Browse files
committed
Merge #69: cmake, ci: Add native macOS builds
fe71a1c fixup! ci: Test CMake edge cases (Hennadii Stepanov) Pull request description: Only CI changes. Top commit has no ACKs. Tree-SHA512: cb56b4c5cd12acff2f36848ef9f1f7d8af2d50a97cee4f3cfb7ceb1ee40691035c54c7d3a130b2bf0b4ee77bc10238e629aa20e14aa46333da246a8940c85443
2 parents 23fd96c + fe71a1c commit d128e8a

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/cmake.yml

+75
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,78 @@ jobs:
324324
run: |
325325
cmake --install build --prefix install --config Release
326326
tree /f install
327+
328+
329+
macos-native-x86_64:
330+
name: ${{ matrix.conf.name }}
331+
runs-on: macos-13
332+
333+
strategy:
334+
fail-fast: false
335+
matrix:
336+
conf:
337+
- name: 'macOS 13 native, x86_64, Xcode 14.3.1'
338+
xcode_path: '/Applications/Xcode_14.3.1.app'
339+
ccache_id: 'macos-13-xcode-14.3.1'
340+
- name: 'macOS 13 native, x86_64, Xcode 15.1'
341+
xcode_path: '/Applications/Xcode_15.1.app'
342+
ccache_id: 'macos-13-xcode-15.1'
343+
344+
steps:
345+
- name: Checkout
346+
uses: actions/checkout@v4
347+
348+
- name: Clang version
349+
run: |
350+
sudo xcode-select --switch ${{ matrix.conf.xcode_path }}
351+
clang --version
352+
353+
- name: Install Homebrew packages
354+
env:
355+
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
356+
run: |
357+
brew install ccache cmake pkg-config boost libevent berkeley-db@4 libnatpmp miniupnpc zeromq tree
358+
echo "CCACHE_DIR=${{ runner.temp }}/ccache" >> "$GITHUB_ENV"
359+
360+
- name: CMake version
361+
run: |
362+
cmake --version
363+
ctest --version
364+
365+
- name: Restore Ccache cache
366+
uses: actions/cache/restore@v3
367+
id: ccache-cache
368+
with:
369+
path: ${{ env.CCACHE_DIR }}
370+
key: ${{ matrix.conf.ccache_id }}-ccache-${{ github.run_id }}
371+
restore-keys: ${{ matrix.conf.ccache_id }}-ccache-
372+
373+
- name: Generate build system
374+
run: |
375+
cmake -B build
376+
377+
- name: Build
378+
run: |
379+
ccache --zero-stats
380+
cmake --build build -j $(sysctl -n hw.logicalcpu)
381+
382+
- name: Ccache stats
383+
run: |
384+
ccache --version | head -n 1
385+
ccache --show-stats --verbose
386+
387+
- name: Save Ccache cache
388+
uses: actions/cache/save@v3
389+
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
390+
with:
391+
path: ${{ env.CCACHE_DIR }}
392+
key: ${{ matrix.conf.ccache_id }}-ccache-${{ github.run_id }}
393+
394+
- name: Test
395+
run: |
396+
ctest --test-dir build -j $(sysctl -n hw.logicalcpu)
397+
398+
- name: Install
399+
run: |
400+
cmake --install build --prefix install
401+
tree install

0 commit comments

Comments
 (0)