-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (72 loc) · 2.47 KB
/
Copy pathmacOS_smoke-tests.yml
File metadata and controls
79 lines (72 loc) · 2.47 KB
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
name: 🍎 macOS Smoke Tests
on:
workflow_call:
workflow_dispatch:
push:
branches-ignore:
- main
- 'gh-readonly-queue/**'
merge_group:
jobs:
macos_tests_summary:
name: macOS Tests Summary
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if code files changed
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
code:
- 'lib/**'
- 'include/**'
- 'tools/**'
- 'CMakeLists.txt'
- 'cmake/**'
- name: Install dependencies
if: steps.changes.outputs.code == 'true'
run: |
brew install llvm@18
brew link --force llvm@18
pip install lit
brew install bison flex ccache
brew link --force bison flex ccache
echo "$(brew --prefix flex)/bin" >> "$GITHUB_PATH"
echo "$(brew --prefix bison)/bin" >> "$GITHUB_PATH"
echo "$(brew --prefix ccache)/libexec" >> "$GITHUB_PATH"
mkdir -p "$HOME/Library/Caches/ccache"
- name: Cache ccache
if: steps.changes.outputs.code == 'true'
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ccache-${{ runner.os }}-clang18-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: |
ccache-${{ runner.os }}-clang18-
- name: Configure and test
if: steps.changes.outputs.code == 'true'
run: |
LLVM_DIR="$(brew --prefix llvm@18)/lib/cmake/llvm"
FLEX_ROOT="$(brew --prefix flex)"
FLEX_INC="$(brew --prefix flex)/include"
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DLLVM_DIR="$LLVM_DIR" \
-DFLEX_EXECUTABLE="$(brew --prefix flex)/bin/flex" \
-DFLEX_INCLUDE_DIR="$FLEX_INC" \
-DBISON_EXECUTABLE="$(brew --prefix bison)/bin/bison" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_FLAGS="-I$FLEX_ROOT/include"
./coverage.sh
- name: Test results
run: |
if [[ "${{ steps.changes.outputs.code }}" == "false" ]]; then
echo "✅ No code changes detected, skipping macOS tests"
else
echo "✅ All macOS tests passed"
fi