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
|
name: COLMAP (Mac)
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
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-15,
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 }}
GLOG_v: 2
GLOG_logtostderr: 1
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 \
freeimage \
curl \
metis \
glog \
googletest \
ceres-solver \
qt \
glew \
cgal \
sqlite3 \
ccache
brew link --force libomp
- name: Configure and build
run: |
export PATH="/usr/local/opt/qt/bin:$PATH"
cmake --version
mkdir build
cd build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.config.cmakeBuildType }} \
-DTESTS_ENABLED=ON \
-DQt6_DIR="$(brew --prefix qt)/lib/cmake/Qt6"
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
|