Skip to content

cdcseacave is building OpenMVS #425

cdcseacave is building OpenMVS

cdcseacave is building OpenMVS #425

name: Continuous Integration
run-name: ${{ github.actor }} is building OpenMVS
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
schedule:
- cron: '23 23 * * 5'
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
env:
BUILD_DIR: make
CTEST_OUTPUT_ON_FAILURE: 1
CI_PARALLEL_JOBS: 2
VCPKG_FEATURE_FLAGS: manifests,binarycaching,registries
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg-cache,readwrite
VCPKG_COMMIT: 'c3867e714dd3a51c272826eea77267876517ed99'
defaults:
run:
shell: bash
jobs:
build-tests:
name: Build on ${{ matrix.os }}
if: github.event_name != 'schedule'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
triplet: x64-windows-release
build-type: Release
cmake-extra-args: -A x64
artifact-name: OpenMVS_Windows_Release_x64
- os: ubuntu-latest
triplet: x64-linux-release
build-type: Release
cmake-extra-args: -G Ninja
artifact-name: OpenMVS_Ubuntu_Release_x64
- os: macos-latest
triplet: arm64-osx
build-type: Release
cmake-extra-args: -G Ninja
artifact-name: OpenMVS_macOS_Release_arm64
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
BUILD_CONFIG: ${{ matrix.build-type }}
CMAKE_EXTRA_ARGS: ${{ matrix.cmake-extra-args }}
steps:
- &checkout-step
name: Checkout
uses: actions/checkout@v4
- &cache-vcpkg-step
name: Cache vcpkg binary packages
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg-cache
key: vcpkg-${{ env.VCPKG_DEFAULT_TRIPLET }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ env.VCPKG_DEFAULT_TRIPLET }}-${{ env.VCPKG_COMMIT }}-
- &setup-vcpkg-step
name: Setup vcpkg and cache artifacts
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
- name: Install Ubuntu dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -y
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
- name: Install macOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew install automake autoconf autoconf-archive libtool ninja
- &configure-step
name: Configure CMake
run: |
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_CONFIG }} -DVCPKG_ROOT=${{ env.VCPKG_ROOT }} -DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }} -DOpenMVS_USE_CUDA=OFF ${{ env.CMAKE_EXTRA_ARGS }}
- &build-step
name: Build
working-directory: ./${{ env.BUILD_DIR }}
run: |
rm -rf ../vcpkg/buildtrees
rm -rf ../vcpkg/downloads
cmake --build . --config ${{ env.BUILD_CONFIG }} --parallel ${{ env.CI_PARALLEL_JOBS }}
- name: Unit Tests
working-directory: ./${{ env.BUILD_DIR }}
run: |
ctest --parallel ${{ env.CI_PARALLEL_JOBS }} --build-config ${{ env.BUILD_CONFIG }}
- name: Deploy release
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: |
${{ github.workspace }}/${{ env.BUILD_DIR }}/bin/**
!${{ github.workspace }}/${{ env.BUILD_DIR }}/bin/**/*.exp
msvc-code-analysis:
name: MSVC Code Analysis
runs-on: windows-latest
permissions:
contents: read
security-events: write
actions: read
env:
VCPKG_DEFAULT_TRIPLET: x64-windows-release
BUILD_CONFIG: Release
CMAKE_EXTRA_ARGS: -A x64
steps:
- *checkout-step
- *cache-vcpkg-step
- *setup-vcpkg-step
- *configure-step
- *build-step
- name: Initialize MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@04825f6d9e00f87422d6bf04e1a38b1f3ed60d99
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.BUILD_DIR }}
ruleset: NativeRecommendedRules.ruleset
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}