Debian Codegraph @

.github/workflows/build-mac.yml

raw
1 name: COLMAP (Mac)
2
3 concurrency:
4 group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
6
7 on:
8 push:
9 branches:
10 - main
11 - release/*
12 pull_request:
13 types: [ assigned, opened, synchronize, reopened ]
14 release:
15 types: [ published, edited ]
16
17 jobs:
18 build:
19 name: ${{ matrix.config.os }} ${{ matrix.config.arch }} ${{ matrix.config.cmakeBuildType }}
20 runs-on: ${{ matrix.config.os }}
21 strategy:
22 matrix:
23 config: [
24 {
25 os: macos-15,
26 arch: arm64,
27 cmakeBuildType: Release,
28 },
29 ]
30
31 env:
32 COMPILER_CACHE_DIR: ${{ github.workspace }}/compiler-cache
33 CCACHE_DIR: ${{ github.workspace }}/compiler-cache/ccache
34 CCACHE_BASEDIR: ${{ github.workspace }}
35 CCACHE_NOHASHDIR: "true"
36 CCACHE_COMPILERCHECK: content
37 CCACHE_MAXSIZE: 100M
38 GLOG_v: 2
39 GLOG_logtostderr: 1
40
41 steps:
42 - uses: actions/checkout@v7
43
44 - name: Restore compiler cache
45 uses: ./.github/actions/compiler-cache
46 id: cache-compiler
47 with:
48 mode: restore
49 path: ${{ env.COMPILER_CACHE_DIR }}
50 key-suffix: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.cmakeBuildType }}
51
52 - name: Setup Mac
53 run: |
54 brew install \
55 cmake \
56 ninja \
57 boost \
58 eigen \
59 openimageio \
60 curl \
61 metis \
62 glog \
63 googletest \
64 ceres-solver \
65 qt \
66 glew \
67 cgal \
68 sqlite3 \
69 ccache \
70 libomp
71 brew link --force libomp
72 ccache --zero-stats
73
74 - name: Configure and build
75 run: |
76 export PATH="/usr/local/opt/qt/bin:$PATH"
77 cmake --version
78 mkdir -p build
79 cd build
80 cmake .. \
81 -GNinja \
82 -DCMAKE_BUILD_TYPE=${{ matrix.config.cmakeBuildType }} \
83 -DTESTS_ENABLED=ON \
84 -DWERROR_ENABLED=ON \
85 -DQt6_DIR="$(brew --prefix qt)/lib/cmake/Qt6"
86 ninja
87
88 - name: Run tests
89 run: |
90 cd build
91 set +e
92 ctest --output-on-failure
93
94 - name: Export package
95 run: |
96 ./scripts/shell/build_mac_app.sh build/src/colmap/exe/colmap
97
98 - name: Upload package
99 uses: actions/upload-artifact@v7
100 with:
101 name: colmap-arm64-macos
102 path: build/src/colmap/exe/COLMAP-mac.zip
103
104 - name: Cleanup compiler cache
105 run: |
106 set -x
107 ccache --cleanup
108 ccache --show-stats --verbose
109
110 - name: Save compiler cache
111 uses: ./.github/actions/compiler-cache
112 with:
113 mode: save
114 key: ${{ steps.cache-compiler.outputs.key }}
115 path: ${{ env.COMPILER_CACHE_DIR }}
116 cache-hit: ${{ steps.cache-compiler.outputs.cache-hit }}