-
Notifications
You must be signed in to change notification settings - Fork 9
80 lines (67 loc) · 2.35 KB
/
ci-macos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: ci-macos
on:
push:
tags-ignore:
- v*.*
branches:
- '*'
pull_request:
branches:
- '*'
permissions:
contents: read
jobs:
build:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
compiler: [ninja-clang, ninja-gcc]
cxx_version: [17, 20]
target: [Debug, Release]
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache CMake build files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: build
key: ${{ runner.os }}-cmake-${{ matrix.compiler }}-${{ matrix.cxx_version }}-${{ matrix.target }}
restore-keys: |
${{ runner.os }}-cmake-${{ matrix.compiler }}-${{ matrix.cxx_version }}-
${{ runner.os }}-cmake-${{ matrix.compiler }}-
- name: install homebrew formulae
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: install ninja
run: brew install ninja
- name: update AppleClang to 14.0.3
run: sudo xcode-select -s /Applications/Xcode_14.3.app/Contents/Developer
- name: configure
run: cmake -S . --preset=${{matrix.compiler}} -B build -DCMAKE_CXX_STANDARD=${{matrix.cxx_version}}
- name: build
run: cmake --build build --config=${{matrix.target}}
test:
runs-on: macos-14
needs: build
strategy:
fail-fast: false
matrix:
compiler: [ninja-clang, ninja-gcc]
cxx_version: [17, 20]
target: [Debug, Release]
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache CMake build files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: build
key: ${{ runner.os }}-cmake-${{ matrix.compiler }}-${{ matrix.cxx_version }}-${{ matrix.target }}
- name: test
run: cd build && ctest -C ${{matrix.target}} --output-on-failure