-
Notifications
You must be signed in to change notification settings - Fork 76
148 lines (131 loc) · 5.56 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: macOS
on:
push:
# create:
# tags:
# - v*
jobs:
build-test:
name: Build and Test macOS
strategy:
matrix:
# runs-on: [ubuntu-latest, macOS-latest]
runs-on: [macOS-latest]
fail-fast: false
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Cache pip macOS
uses: actions/cache@v1
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache Homebrew Downloads
if: startsWith(runner.os, 'macOS')
uses: actions/cache@v1
with:
path: ~/Library/Caches/Homebrew
# key: ${{ runner.OS }}-build-downloads-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.OS }}-build-downloads
restore-keys: |
${{ runner.OS }}-build-downloads-${{ env.cache-name }}-
${{ runner.OS }}-build-downloads-
# - name: Cache Homebrew
# if: matrix.os == 'macOS-latest'
# uses: actions/cache@v1
# with:
# path: /usr/local/Homebrew
# # key: ${{ runner.OS }}-build-localbrew-${{ hashFiles('**/package-lock.json') }}
# key: ${{ runner.OS }}-build-localbrew
# restore-keys: |
# ${{ runner.OS }}-build-localbrew-${{ env.cache-name }}-
# ${{ runner.OS }}-build-localbrew-
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/[email protected]
with:
path: ${{runner.workspace}}/.ccache
key: ${{ runner.OS }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ runner.OS }}-ccache-
- name: Install Dependencies
run: ./install_dependencies.sh
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
if: startsWith(runner.os, 'macOS')
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
# brew link --force qt@5
run: |
mkdir -p build
cd build
export PATH="$(brew --prefix qt@5)/bin:$PATH"
brew ls llvm@14
brew --prefix llvm@14
ls -l /usr/local
ls -l /opt/homebrew/opt
ls -l /opt/homebrew/opt/llvm@14
ls -l /opt/homebrew/opt/llvm@14/bin
ls -l /opt/homebrew/opt/llvm@14/bin/clang
cmake -G Ninja .. -DQt5_DIR="$(brew --prefix qt@5)/lib/cmake" -DCMAKE_BUILD_TYPE=Debug -DBUILD_ALL_PLUGINS=ON -DBUILD_TESTS=ON -DPL_GUI=ON -DCMAKE_C_COMPILER=$(brew --prefix llvm@14)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm@14)/bin/clang++
env:
LDFLAGS: "-L$(brew --prefix qt@5)/lib -L$(brew --prefix llvm@14)/lib -Wl,-rpath,$(brew --prefix llvm@14)/lib"
CPPFLAGS: "-I$(brew --prefix llvm@14)/include"
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M
- name: Build
if: startsWith(runner.os, 'macOS')
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cd build
export PATH="$(brew --prefix qt@5)/bin:$PATH"
export BUILD_TYPE=Debug
cmake --build . --target all --clean-first --config $BUILD_TYPE
env:
LDFLAGS: "-L$(brew --prefix qt@5)/lib -L$(brew --prefix llvm@14)/lib -Wl,-rpath,$(brew --prefix llvm@14)/lib"
CPPFLAGS: "-I$(brew --prefix llvm@14)/include"
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v1
- name: Test
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd build
ninja
ctest --rerun-failed --output-on-failure
# ninja -v hal_coverage
# bash <(curl -s https://codecov.io/bash) -f hal_coverage.info.cleaned || echo "Codecov did not collect coverage reports"
env:
LDFLAGS: "-L$(brew --prefix qt@5)/lib -L$(brew --prefix llvm@14)/lib -Wl,-rpath,$(brew --prefix llvm@14)/lib"
CPPFLAGS: "-I$(brew --prefix llvm@14)/include"
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 500M