Skip to content

CI: add macOS workflow with LLVM 9 #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: macOS CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
ubuntu:
name: "macOS (llvm: ${{matrix.llvm}}, build: ${{matrix.build}})"
strategy:
fail-fast: false
matrix:
llvm: [9]
build: ['RelWithDebInfo', 'Debug']

runs-on: macos-latest
env:
CC: clang
CXX: clang++

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true

- name: Install dependencies
# FIXME: we should not depend on GNU coreutils
run: brew install coreutils ccache llvm@${{matrix.llvm}} z3

- name: Set environment
id: env
run: |
echo "CCACHE_BASEDIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=400M" >> $GITHUB_ENV

echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH

echo "timestamp=$(date -u +%Y-%m-%dT%H:%M:%S%z)" >> $GITHUB_OUTPUT

- name: Set up ccache
uses: actions/cache@v3
with:
path: .ccache
key: macos-${{matrix.llvm}}-${{matrix.build}}-${{steps.env.outputs.timestamp}}
restore-keys: macos-${{matrix.llvm}}-${{matrix.build}}

- name: Build Symbiotic
run: |
./system-build.sh -j"$(sysctl -n hw.logicalcpu)" build-type=${{matrix.build}} \
llvm-config="$(brew --prefix llvm@${{matrix.llvm}})/bin/llvm-config"

- name: Run tests
run: make -C tests

- name: ccache statistics
run: ccache -s
6 changes: 5 additions & 1 deletion system-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ if [ -z "$LLVM_DIR" ]; then
fi

# detect the link type of LLVM that we use
if [ "$($LLVM_CONFIG --shared-mode --libs)" = "shared" ]; then
if [ "$($LLVM_CONFIG --shared-mode --libs)" = "shared" ] || \
# TODO: $LLVM_CONFIG --shared-mode is broken on macOS:
# https://bugs.llvm.org/show_bug.cgi?id=40252
# This workaround won't be needed when we switch to CMake.
stat "$LLVM_LIB_DIR"/libLLVM.dylib; then
LLVM_DYLIB="on"
else
LLVM_DYLIB="off"
Expand Down