From ffcbd684ac5dee483a82bcd3938f2c210adaf4c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 13 Feb 2024 18:50:47 +0000 Subject: [PATCH 1/4] Migrate MacOS CI pipeline from ADO to Github --- .azure-pipelines/build.yaml | 8 +-- .github/workflows/build-mac.yaml | 85 ++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build-mac.yaml diff --git a/.azure-pipelines/build.yaml b/.azure-pipelines/build.yaml index 828889aa76..675a564c6a 100644 --- a/.azure-pipelines/build.yaml +++ b/.azure-pipelines/build.yaml @@ -41,10 +41,10 @@ jobs: # displayName: 'Ubuntu 22.04 (ClangTidy)' # ubuntuVersion: 22.04 # cmakeBuildType: ClangTidy - - template: build-mac.yaml - parameters: - displayName: 'Mac 12' - macVersion: 12 + # - template: build-mac.yaml + # parameters: + # displayName: 'Mac 12' + # macVersion: 12 - template: build-docker.yaml parameters: displayName: 'Docker' diff --git a/.github/workflows/build-mac.yaml b/.github/workflows/build-mac.yaml new file mode 100644 index 0000000000..4db1f72519 --- /dev/null +++ b/.github/workflows/build-mac.yaml @@ -0,0 +1,85 @@ +name: COLMAP + +on: + push: + branches: + - main + pull_request: + types: [ assigned, opened, synchronize, reopened ] + release: + types: [ published, edited ] + +jobs: + build: + name: ${{ matrix.config.os }} ${{ matrix.config.arch }} + runs-on: ${{ matrix.config.os }} + strategy: + matrix: + config: [ + {os: macos-13, arch: x86_64}, + {os: macos-13, arch: arm64}, + ] + + 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 }}-${{ github.run_id }}-${{ github.run_number }} + restore-keys: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }} + path: ${{ env.COMPILER_CACHE_DIR }} + + - name: Setup Ubuntu + run: | + 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 \ + -DTESTS_ENABLED=ON \ + -DQt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5 + ninja + + - name: Run tests + run: | + cd build + ctest + tests_pass=$? + if [ $tests_pass -ne 0 ]; then + echo "\n\n\nTests failed, rerunning with verbose output" + ctest --rerun-failed --output-on-failure + fi + exit $tests_pass + + - name: Cleanup compiler cache + run: | + set -x + ccache --show-stats --verbose + ccache --evict-older-than 1d + ccache --show-stats --verbose From 5952c7919c66b6aaaa7b1f5af206e358e3c1190f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 13 Feb 2024 18:57:07 +0000 Subject: [PATCH 2/4] d --- .github/workflows/build-mac.yaml | 19 +++-- .github/workflows/build-ubuntu.yml | 108 ++++++++++++++--------------- 2 files changed, 68 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build-mac.yaml b/.github/workflows/build-mac.yaml index 4db1f72519..be31a6efed 100644 --- a/.github/workflows/build-mac.yaml +++ b/.github/workflows/build-mac.yaml @@ -11,13 +11,21 @@ on: jobs: build: - name: ${{ matrix.config.os }} ${{ matrix.config.arch }} + name: ${{ matrix.config.os }} ${{ matrix.config.arch }} ${{ matrix.config.cmakeBuildType }} runs-on: ${{ matrix.config.os }} strategy: matrix: config: [ - {os: macos-13, arch: x86_64}, - {os: macos-13, arch: arm64}, + { + os: macos-13, + arch: x86_64, + cmakeBuildType: Release, + }, + { + os: macos-13, + arch: arm64, + cmakeBuildType: Release, + }, ] env: @@ -31,8 +39,8 @@ jobs: - uses: actions/cache@v4 id: cache-builds with: - key: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.run_id }}-${{ github.run_number }} - restore-keys: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }} + 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 Ubuntu @@ -62,6 +70,7 @@ jobs: cd build cmake .. \ -GNinja \ + -DCMAKE_BUILD_TYPE=${{ matrix.config.cmakeBuildType }} \ -DTESTS_ENABLED=ON \ -DQt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5 ninja diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index bc4beebb76..254c5204c1 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -16,60 +16,60 @@ jobs: strategy: matrix: config: [ - { - os: ubuntu-22.04, - cmakeBuildType: Release, - asanEnabled: false, - guiEnabled: true, - cudaEnabled: false, - e2eTests: true, - checkCodeFormat: true, - }, - { - os: ubuntu-22.04, - cmakeBuildType: Release, - asanEnabled: false, - guiEnabled: false, - cudaEnabled: true, - e2eTests: false, - checkCodeFormat: false, - }, - { - os: ubuntu-22.04, - cmakeBuildType: Release, - asanEnabled: true, - guiEnabled: false, - cudaEnabled: false, - e2eTests: false, - checkCodeFormat: false, - }, - { - os: ubuntu-22.04, - cmakeBuildType: ClangTidy, - asanEnabled: false, - guiEnabled: false, - cudaEnabled: false, - e2eTests: false, - checkCodeFormat: false, - }, - { - os: ubuntu-20.04, - cmakeBuildType: Release, - asanEnabled: false, - guiEnabled: true, - cudaEnabled: false, - e2eTests: false, - checkCodeFormat: false, - }, - { - os: ubuntu-20.04, - cmakeBuildType: Release, - asanEnabled: false, - guiEnabled: false, - cudaEnabled: true, - e2eTests: false, - checkCodeFormat: false, - }, + { + os: ubuntu-22.04, + cmakeBuildType: Release, + asanEnabled: false, + guiEnabled: true, + cudaEnabled: false, + e2eTests: true, + checkCodeFormat: true, + }, + { + os: ubuntu-22.04, + cmakeBuildType: Release, + asanEnabled: false, + guiEnabled: false, + cudaEnabled: true, + e2eTests: false, + checkCodeFormat: false, + }, + { + os: ubuntu-22.04, + cmakeBuildType: Release, + asanEnabled: true, + guiEnabled: false, + cudaEnabled: false, + e2eTests: false, + checkCodeFormat: false, + }, + { + os: ubuntu-22.04, + cmakeBuildType: ClangTidy, + asanEnabled: false, + guiEnabled: false, + cudaEnabled: false, + e2eTests: false, + checkCodeFormat: false, + }, + { + os: ubuntu-20.04, + cmakeBuildType: Release, + asanEnabled: false, + guiEnabled: true, + cudaEnabled: false, + e2eTests: false, + checkCodeFormat: false, + }, + { + os: ubuntu-20.04, + cmakeBuildType: Release, + asanEnabled: false, + guiEnabled: false, + cudaEnabled: true, + e2eTests: false, + checkCodeFormat: false, + }, ] env: From 4124b8013e483ed205b5f3d621d8e8ffc0d55541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 13 Feb 2024 19:18:29 +0000 Subject: [PATCH 3/4] d --- .github/workflows/build-mac.yaml | 6 +++--- .github/workflows/build-ubuntu.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-mac.yaml b/.github/workflows/build-mac.yaml index be31a6efed..e06757555b 100644 --- a/.github/workflows/build-mac.yaml +++ b/.github/workflows/build-mac.yaml @@ -1,4 +1,4 @@ -name: COLMAP +name: COLMAP (Mac) on: push: @@ -11,7 +11,7 @@ on: jobs: build: - name: ${{ matrix.config.os }} ${{ matrix.config.arch }} ${{ matrix.config.cmakeBuildType }} + name: ${{ matrix.config.arch }} ${{ matrix.config.cmakeBuildType }} runs-on: ${{ matrix.config.os }} strategy: matrix: @@ -43,7 +43,7 @@ jobs: restore-keys: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.cmakeBuildType }} path: ${{ env.COMPILER_CACHE_DIR }} - - name: Setup Ubuntu + - name: Setup Mac run: | brew install \ cmake \ diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 254c5204c1..22e35ef185 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -1,4 +1,4 @@ -name: COLMAP +name: COLMAP (Ubuntu) on: push: @@ -11,7 +11,7 @@ on: jobs: build: - name: ${{ matrix.config.os }} ${{ matrix.config.arch }} ${{ matrix.config.cmakeBuildType }} ${{ matrix.config.cudaEnabled && 'CUDA' || '' }} ${{ matrix.config.asanEnabled && 'ASan' || '' }} + name: ${{ matrix.config.arch }} ${{ matrix.config.cmakeBuildType }} ${{ matrix.config.cudaEnabled && 'CUDA' || '' }} ${{ matrix.config.asanEnabled && 'ASan' || '' }} runs-on: ${{ matrix.config.os }} strategy: matrix: From 456391a32ecfc8f352a52d20ba3b28053744f630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 13 Feb 2024 19:47:45 +0000 Subject: [PATCH 4/4] d --- .github/workflows/build-mac.yaml | 5 ----- .github/workflows/build-ubuntu.yml | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-mac.yaml b/.github/workflows/build-mac.yaml index e06757555b..3a1816c9be 100644 --- a/.github/workflows/build-mac.yaml +++ b/.github/workflows/build-mac.yaml @@ -21,11 +21,6 @@ jobs: arch: x86_64, cmakeBuildType: Release, }, - { - os: macos-13, - arch: arm64, - cmakeBuildType: Release, - }, ] env: diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 22e35ef185..1b07d4c639 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -11,7 +11,7 @@ on: jobs: build: - name: ${{ matrix.config.arch }} ${{ matrix.config.cmakeBuildType }} ${{ matrix.config.cudaEnabled && 'CUDA' || '' }} ${{ matrix.config.asanEnabled && 'ASan' || '' }} + name: ${{ matrix.config.cmakeBuildType }} ${{ matrix.config.cudaEnabled && 'CUDA' || '' }} ${{ matrix.config.asanEnabled && 'ASan' || '' }} runs-on: ${{ matrix.config.os }} strategy: matrix: @@ -84,8 +84,8 @@ jobs: - uses: actions/cache@v4 id: cache-builds with: - key: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.cmakeBuildType }}-${{ matrix.config.asanEnabled }}--${{ matrix.config.cudaEnabled }}-${{ github.run_id }}-${{ github.run_number }} - restore-keys: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.cmakeBuildType }}-${{ matrix.config.asanEnabled }}--${{ matrix.config.cudaEnabled }} + key: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.cmakeBuildType }}-${{ matrix.config.asanEnabled }}--${{ matrix.config.cudaEnabled }}-${{ github.run_id }}-${{ github.run_number }} + restore-keys: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.cmakeBuildType }}-${{ matrix.config.asanEnabled }}--${{ matrix.config.cudaEnabled }} path: ${{ env.COMPILER_CACHE_DIR }} - name: Install compiler cache