From d9ccd29229a4336599cc4fd10a5e0f1957760136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 19 Sep 2024 13:06:30 +0200 Subject: [PATCH] d --- .github/workflows/mac.yml | 83 ++++++++++++++++++++++++++++++++++++ .github/workflows/ubuntu.yml | 2 +- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/mac.yml diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 0000000..a88e605 --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,83 @@ +name: COLMAP (Mac) + +on: + push: + branches: + - main + 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: | + brew install \ + cmake \ + ninja \ + boost \ + eigen \ + flann \ + freeimage \ + metis \ + glog \ + googletest \ + ceres-solver \ + qt5 \ + glew \ + cgal \ + sqlite3 \ + ccache + + - name: Configure and build + run: | + cmake --version + mkdir build + cd build + cmake .. \ + -GNinja \ + -DCMAKE_BUILD_TYPE=${{ matrix.config.cmakeBuildType }} \ + -DTESTS_ENABLED=ON \ + -DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)" + 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 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 455e8d8..a8246f9 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -185,4 +185,4 @@ jobs: # Delete cache older than 10 days. find "$CTCACHE_DIR"/*/ -mtime +10 -print0 | xargs -0 rm -rf echo "Size of ctcache after: $(du -sh $CTCACHE_DIR)" - echo "Number of ctcache files after: $(find $CTCACHE_DIR | wc -l)" \ No newline at end of file + echo "Number of ctcache files after: $(find $CTCACHE_DIR | wc -l)"''