1+ name : Build Linux
2+
3+ on :
4+ workflow_call :
5+
6+ jobs :
7+ build-linux :
8+ runs-on : ubuntu-latest
9+ container :
10+ image : " alicevision/alicevision-deps:2026.03.30-rocky9-cuda12.1.1"
11+ env :
12+ DEPS_INSTALL_DIR : /opt/AliceVision_install
13+ BUILD_TYPE : Release
14+ CTEST_OUTPUT_ON_FAILURE : 1
15+ ALICEVISION_ROOT : ${{ github.workspace }}/../AV_install
16+ ALICEVISION_SENSOR_DB : ${{ github.workspace }}/../AV_install/share/aliceVision/cameraSensors.db
17+ ALICEVISION_LENS_PROFILE_INFO : " "
18+ steps :
19+ - uses : actions/checkout@v1
20+
21+ - name : Setup ccache
22+ uses : hendrikmuhs/ccache-action@v1.2
23+ with :
24+ # Isolate writes per ref (branch/PR) to reduce cross-PR cache contamination.
25+ key : ccache-${{ runner.os }}-sonarqube-${{ github.ref_name }}-${{ hashFiles('CMakeLists.txt', 'src/CMakeLists.txt', 'vcpkg.json', 'vcpkg-configuration.json', '.github/workflows/build-linux.yml') }}
26+ restore-keys : |
27+ ccache-${{ runner.os }}-sonarqube-${{ github.ref_name }}-
28+ ccache-${{ runner.os }}-sonarqube-develop-
29+ ccache-${{ runner.os }}-
30+ max-size : " 1000M"
31+
32+ - name : Install Build Wrapper
33+ uses : SonarSource/sonarqube-scan-action/install-build-wrapper@v7.1
34+
35+ - name : Prepare File Tree
36+ run : |
37+ mkdir ./build
38+ mkdir ../AV_install
39+ mkdir -p ${{ github.workspace }}/bw-output
40+ mkdir -p ${{ github.workspace }}/analysisCache
41+
42+ - name : Cache SonarCloud CFamily (incremental analysis)
43+ uses : actions/cache@v4
44+ with :
45+ path : /root/.sonar/cache
46+ key : ${{ runner.os }}-cfamily-${{ hashFiles('src/**/*.cpp', 'src/**/*.hpp', '**/CMakeLists.txt') }}
47+ restore-keys : ${{ runner.os }}-cfamily-
48+
49+ - name : Configure CMake
50+ working-directory : ./build
51+ run : |
52+ cmake .. \
53+ -G Ninja \
54+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
55+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
56+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
57+ -DBUILD_SHARED_LIBS=ON \
58+ -DCMAKE_PREFIX_PATH="${DEPS_INSTALL_DIR}" \
59+ -DCMAKE_INSTALL_PREFIX="${ALICEVISION_ROOT}" \
60+ -DTARGET_ARCHITECTURE=core \
61+ -DALICEVISION_BUILD_TESTS=OFF \
62+ -DALICEVISION_BUILD_SWIG_BINDING=OFF \
63+ -DALICEVISION_USE_OPENCV=ON \
64+ -DALICEVISION_USE_CUDA=OFF \
65+ -DALICEVISION_USE_CCTAG=OFF \
66+ -DALICEVISION_USE_POPSIFT=OFF \
67+ -DALICEVISION_USE_ALEMBIC=ON \
68+ -DALICEVISION_USE_USD=ON \
69+ -DOpenCV_DIR="${DEPS_INSTALL_DIR}/share/OpenCV" \
70+ -DCeres_DIR="${DEPS_INSTALL_DIR}/share/Ceres" \
71+ -DAlembic_DIR="${DEPS_INSTALL_DIR}/lib/cmake/Alembic"
72+
73+ - name : Build
74+ working-directory : ./build
75+ run : |
76+ build-wrapper-linux-x86-64 --out-dir ${{ github.workspace }}/bw-output cmake --build . -j$(nproc)
77+
78+ - name : SonarQube Scan
79+ uses : SonarSource/sonarqube-scan-action@v7.1
80+ env :
81+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
82+ with :
83+ args : >
84+ --define sonar.cfamily.compile-commands=${{ github.workspace }}/bw-output/compile_commands.json
0 commit comments