@@ -4,16 +4,27 @@ run-name: ${{ github.actor }} is building OpenMVS
44permissions :
55 contents : read
66
7+ concurrency :
8+ group : ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+ cancel-in-progress : true
10+
711on :
812 push :
913 branches : [master, develop]
1014 pull_request :
1115 branches : [master, develop]
16+ schedule :
17+ - cron : ' 23 23 * * 5'
1218 # Allows to run this workflow manually from the Actions tab
1319 workflow_dispatch :
1420
1521env :
22+ BUILD_DIR : make
1623 CTEST_OUTPUT_ON_FAILURE : 1
24+ CI_PARALLEL_JOBS : 2
25+ VCPKG_FEATURE_FLAGS : manifests,binarycaching,registries
26+ VCPKG_BINARY_SOURCES : clear;x-gha,readwrite
27+ VCPKG_COMMIT : ' c3867e714dd3a51c272826eea77267876517ed99'
1728
1829defaults :
1930 run :
@@ -22,6 +33,7 @@ defaults:
2233jobs :
2334 build-tests :
2435 name : Build on ${{ matrix.os }}
36+ if : github.event_name != 'schedule'
2537 runs-on : ${{ matrix.os }}
2638 strategy :
2739 fail-fast : false
@@ -30,31 +42,36 @@ jobs:
3042 - os : windows-latest
3143 triplet : x64-windows-release
3244 build-type : Release
45+ cmake-extra-args : -A x64
46+ artifact-name : OpenMVS_Windows_Release_x64
3347 - os : ubuntu-latest
3448 triplet : x64-linux-release
3549 build-type : Release
50+ cmake-extra-args : -G Ninja
51+ artifact-name : OpenMVS_Ubuntu_Release_x64
3652 - os : macos-latest
3753 triplet : arm64-osx
3854 build-type : Release
55+ cmake-extra-args : -G Ninja
56+ artifact-name : OpenMVS_macOS_Release_arm64
3957 env :
40- # Turn on manifests and binary caching; use the GHA backend
41- VCPKG_FEATURE_FLAGS : manifests,binarycaching,registries
42- VCPKG_BINARY_SOURCES : clear;x-gha,readwrite
4358 VCPKG_DEFAULT_TRIPLET : ${{ matrix.triplet }}
44- VCPKG_COMMIT : ' ef7dbf94b9198bc58f45951adcf1f041fcbc5ea0'
4559
4660 steps :
47- - name : Checkout
61+ - &checkout-step
62+ name : Checkout
4863 uses : actions/checkout@v4
4964
50- - name : Export GitHub Actions cache environment variables
65+ - &export-cache-env-step
66+ name : Export GitHub Actions cache environment variables
5167 uses : actions/github-script@v7
5268 with :
5369 script : |
5470 core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
5571 core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
5672
57- - name : Setup vcpkg and cache artifacts
73+ - &setup-vcpkg-step
74+ name : Setup vcpkg and cache artifacts
5875 uses : lukka/run-vcpkg@v11
5976 with :
6077 vcpkgGitCommitId : ${{ env.VCPKG_COMMIT }}
@@ -63,58 +80,64 @@ jobs:
6380 if : matrix.os == 'ubuntu-latest'
6481 run : |
6582 sudo apt-get update -y
66- sudo apt-get install -y autoconf-archive libxmu-dev libdbus-1-dev libxtst-dev libxi-dev libxinerama-dev libxcursor-dev xorg-dev libgl-dev libglu1-mesa-dev autoconf automake bison libtool libltdl-dev pkg-config ninja-build
83+ sudo apt-get install -y autoconf-archive libxmu-dev libdbus-1-dev libxtst-dev libxi-dev libxinerama-dev libxcursor-dev xorg-dev libgl-dev libglu1-mesa-dev autoconf automake bison libtool libltdl-dev pkg-config nasm ninja-build
6784
6885 - name : Install macOS dependencies
6986 if : matrix.os == 'macos-latest'
7087 run : |
7188 brew install automake autoconf autoconf-archive libtool ninja
7289
73- - name : Configure CMake for Windows
74- if : matrix.os == 'windows-latest'
75- run : |
76- cmake -S . -B make -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DOpenMVS_USE_CUDA=OFF
77-
78- - name : Configure CMake for Ubuntu and macOS
79- if : matrix.os != 'windows-latest'
90+ - name : Configure CMake
8091 run : |
81- cmake -S . -B make -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DOpenMVS_USE_CUDA=OFF -G Ninja
92+ cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DVCPKG_ROOT=${{ env.VCPKG_ROOT }} - DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DOpenMVS_USE_CUDA=OFF ${{ matrix.cmake-extra-args }}
8293
8394 - name : Build
84- working-directory : ./make
95+ working-directory : ./${{ env.BUILD_DIR }}
8596 run : |
8697 rm -rf ../vcpkg/buildtrees
8798 rm -rf ../vcpkg/downloads
88- cmake --build . --config ${{ matrix.build-type }} --parallel $(nproc)
99+ cmake --build . --config ${{ matrix.build-type }} --parallel ${{ env.CI_PARALLEL_JOBS }}
89100
90101 - name : Unit Tests
91- working-directory : ./make
102+ working-directory : ./${{ env.BUILD_DIR }}
92103 run : |
93- ctest -j$(nproc) --build-config ${{ matrix.build-type }}
104+ ctest --parallel ${{ env.CI_PARALLEL_JOBS }} --build-config ${{ matrix.build-type }}
94105
95- - name : Deploy Windows release
96- if : matrix.os == 'windows-latest'
106+ - name : Deploy release
97107 uses : actions/upload-artifact@v4
98108 with :
99- name : OpenMVS_Windows_Release_x64
109+ name : ${{ matrix.artifact-name }}
100110 path : |
101- ${{ github.workspace }}/make/bin/**/x64
102- !${{ github.workspace }}/make/bin/**/*.exp
111+ ${{ github.workspace }}/${{ env.BUILD_DIR }}/bin/**
112+ !${{ github.workspace }}/${{ env.BUILD_DIR }}/bin/**/*.exp
113+
114+ msvc-code-analysis :
115+ name : MSVC Code Analysis
116+ runs-on : windows-latest
117+ permissions :
118+ contents : read
119+ security-events : write
120+ actions : read
121+ env :
122+ VCPKG_DEFAULT_TRIPLET : x64-windows-release
103123
104- - name : Deploy Ubuntu release
105- if : matrix.os == 'ubuntu-latest'
106- uses : actions/upload-artifact@v4
124+ steps :
125+ - *checkout-step
126+ - *export-cache-env-step
127+ - *setup-vcpkg-step
128+
129+ - name : Configure CMake for MSVC analysis
130+ run : |
131+ cmake -S . -B ${{ env.BUILD_DIR }} -A x64 -DCMAKE_CONFIGURATION_TYPES=Release -DVCPKG_ROOT=${{ env.VCPKG_ROOT }} -DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }} -DOpenMVS_USE_CUDA=OFF
132+
133+ - name : Initialize MSVC Code Analysis
134+ uses : microsoft/msvc-code-analysis-action@04825f6d9e00f87422d6bf04e1a38b1f3ed60d99
135+ id : run-analysis
107136 with :
108- name : OpenMVS_Ubuntu_Release_x64
109- path : |
110- ${{ github.workspace }}/make/bin/**
111- !${{ github.workspace }}/make/bin/**/*.exp
137+ cmakeBuildDirectory : ${{ env.BUILD_DIR }}
138+ ruleset : NativeRecommendedRules.ruleset
112139
113- - name : Deploy macOS release
114- if : matrix.os == 'macos-latest'
115- uses : actions/upload-artifact@v4
140+ - name : Upload SARIF to GitHub
141+ uses : github/codeql-action/upload-sarif@v3
116142 with :
117- name : OpenMVS_macOS_Release_arm64
118- path : |
119- ${{ github.workspace }}/make/bin/**
120- !${{ github.workspace }}/make/bin/**/*.exp
143+ sarif_file : ${{ steps.run-analysis.outputs.sarif }}
0 commit comments