-
Notifications
You must be signed in to change notification settings - Fork 11
85 lines (72 loc) · 2.68 KB
/
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
81
82
83
84
85
name: macos
on:
push:
pull_request:
branches: [ master ]
jobs:
build-and-test:
name: Build and test ${{matrix.build-type}} mode
runs-on: macos-11
strategy:
matrix:
build-type: [Debug, Release]
steps:
- name: Clone recursively
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
ccache_options: max_size=500M
override_cache_key: mac-latest-ccache-${{matrix.build-type}}
- name: Configure
run: CC=gcc-11 CXX=g++-11 cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DTHORIN_BUILD_TESTING=ON -DTHORIN_BUILD_EXAMPLES=ON -DPython3_ROOT_DIR=$(dirname $(which python3))
- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@v3
with:
path: |
./llvm
key: llvm-14.0.0-mac
- name: Install LLVM and Clang
uses: KyleMayes/[email protected]
with:
version: "14.0.0"
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Install FileCheck
uses: i3h/download-release-asset@v1
with:
owner: fodinabor
repo: FileCheckBuild
tag: latest
file: FileCheck-x86_64-mac
path: ${{github.workspace}}/bin
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install LIT
run: |
python3 -m pip install lit psutil
ln -s ${{github.workspace}}/bin/FileCheck-x86_64-mac ${{github.workspace}}/bin/FileCheck
chmod +x ${{github.workspace}}/bin/FileCheck
- name: Prepare LLVM
run: |
LLVM_PATH=${{ env.LLVM_PATH }}
LLVM_VERSION=${{ matrix.clang }}
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "CPATH=$LLVM_PATH/lib/clang/$LLVM_VERSION/include/" >> $GITHUB_ENV
echo "LDFLAGS=-L$LLVM_PATH/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I$LLVM_PATH/include" >> $GITHUB_ENV
echo "CC=$LLVM_PATH/bin/clang" >> $GITHUB_ENV
echo "CXX=$LLVM_PATH/bin/clang++" >> $GITHUB_ENV
- name: Build
run: cmake --build ${{github.workspace}}/build -v
- name: Run lit test suite
working-directory: ${{github.workspace}}/build
run: |
export PATH=${{github.workspace}}/bin:$PATH
cmake --build ${{github.workspace}}/build -v --target check
- name: Test
working-directory: ${{github.workspace}}/build
run: |
export PATH=${{github.workspace}}/bin:$PATH
ctest --verbose -C ${{matrix.build-type}} --output-on-failure