Skip to content

🍎 macOS Smoke Tests #1814

🍎 macOS Smoke Tests

🍎 macOS Smoke Tests #1814

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 (LLVM ${{ matrix.llvm-version }})
runs-on: macos-15
strategy:
fail-fast: false
matrix:
llvm-version: [22]
env:
LLVM_VERSION: ${{ matrix.llvm-version }}
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/**'
- 'stdlib/**'
- name: Install dependencies
if: steps.changes.outputs.code == 'true'
run: |
brew install llvm@${LLVM_VERSION}
brew link --force llvm@${LLVM_VERSION}
pip install lit
brew install bison flex ccache zig
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 }}-clang${{ matrix.llvm-version }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
restore-keys: |
ccache-${{ runner.os }}-clang${{ matrix.llvm-version }}-
- name: Configure and test
if: steps.changes.outputs.code == 'true'
run: |
LLVM_DIR="$(brew --prefix llvm@${LLVM_VERSION})/lib/cmake/llvm"
LLVM_BIN="$(brew --prefix llvm@${LLVM_VERSION})/bin"
FLEX_ROOT="$(brew --prefix flex)"
FLEX_INC="$(brew --prefix flex)/include"
export PATH="${LLVM_BIN}:$PATH"
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" \
-DGLU_LLVM_VERSION=${LLVM_VERSION}
./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