forked from colmap/colmap
-
Notifications
You must be signed in to change notification settings - Fork 5
88 lines (79 loc) · 2.45 KB
/
build-mac.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
name: COLMAP (Mac)
on:
push:
branches:
- main
- release/*
pull_request:
types: [ assigned, opened, synchronize, reopened ]
release:
types: [ published, edited ]
jobs:
build:
name: ${{ matrix.config.os }} ${{ matrix.config.arch }} ${{ matrix.config.cmakeBuildType }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config: [
{
os: macos-14,
arch: arm64,
cmakeBuildType: Release,
},
]
env:
COMPILER_CACHE_VERSION: 1
COMPILER_CACHE_DIR: ${{ github.workspace }}/compiler-cache
CCACHE_DIR: ${{ github.workspace }}/compiler-cache/ccache
CCACHE_BASEDIR: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache-builds
with:
key: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.cmakeBuildType }}-${{ github.run_id }}-${{ github.run_number }}
restore-keys: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.cmakeBuildType }}
path: ${{ env.COMPILER_CACHE_DIR }}
- name: Setup Mac
run: |
# Fix `brew link` error.
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
brew install \
cmake \
ninja \
boost \
eigen \
flann \
freeimage \
metis \
glog \
googletest \
ceres-solver \
qt5 \
glew \
cgal \
sqlite3 \
ccache
- name: Configure and build
run: |
export PATH="/usr/local/opt/qt@5/bin:$PATH"
cmake --version
mkdir build
cd build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.config.cmakeBuildType }} \
-DTESTS_ENABLED=ON \
-DCMAKE_PREFIX_PATH="/opt/homebrew/opt/flann;/opt/homebrew/opt/metis;/opt/homebrew/opt/suite-sparse;/opt/homebrew/opt/qt@5;/opt/homebrew/opt/freeimage"
ninja
- name: Run tests
run: |
cd build
set +e
ctest --output-on-failure
- name: Cleanup compiler cache
run: |
set -x
ccache --show-stats --verbose
ccache --evict-older-than 1d
ccache --show-stats --verbose