Continuous Integration #111
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
# Skip jobs when only documentation files are changed | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
- 'docs/**' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
- 'docs/**' | |
workflow_dispatch: | |
# Allows manual triggering from GitHub UI or CLI | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
container: ["alicevision/popsift-deps:cuda11.8.0-ubuntu20.04", "alicevision/popsift-deps:cuda12.1.0-ubuntu22.04"] | |
container: | |
image: ${{ matrix.container }} | |
env: | |
DEPS_INSTALL_DIR: /opt/ | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
steps: | |
- uses: actions/checkout@v2 | |
# Cache build artifacts and dependencies (within container) | |
- name: Cache build artifacts | |
id: cache-build | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache | |
/tmp/popsift_cache | |
key: linux-${{ matrix.container }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', '.github/workflows/continuous-integration.yml') }} | |
restore-keys: | | |
linux-${{ matrix.container }}- | |
- name: Make scripts executable | |
run: chmod +x ./.github/scripts/*.sh | |
- name: Build Release Configuration | |
uses: ./.github/actions/build-config | |
with: | |
build-type: 'Release' | |
platform: 'linux' | |
deps-install-dir: ${{ env.DEPS_INSTALL_DIR }} | |
- name: Build Debug Configuration | |
if: ${{ !contains(matrix.container, 'cuda11.8.0') }} | |
uses: ./.github/actions/build-config | |
with: | |
build-type: 'Debug' | |
platform: 'linux' | |
deps-install-dir: ${{ env.DEPS_INSTALL_DIR }} | |
build-windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
cuda_version: ["12.5.1", "12.9.0"] | |
env: | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
# Cache CUDA installation | |
- name: Cache CUDA installation | |
id: cache-cuda | |
uses: actions/cache@v3 | |
with: | |
path: | | |
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA | |
C:\Program Files\NVIDIA Corporation\Installer2 | |
key: cuda-${{ matrix.cuda_version }}-${{ runner.os }} | |
restore-keys: | | |
cuda-${{ matrix.cuda_version }}- | |
- name: Install CUDA | |
if: steps.cache-cuda.outputs.cache-hit != 'true' | |
uses: Jimver/[email protected] | |
with: | |
cuda: ${{ matrix.cuda_version }} | |
method: 'network' | |
sub-packages: '["nvcc", "cudart", "nvtx", "visual_studio_integration"]' | |
use-github-cache: true | |
use-local-cache: true | |
# Add CUDA to PATH if restored from cache | |
- name: Add CUDA to PATH (cached) | |
if: steps.cache-cuda.outputs.cache-hit == 'true' | |
shell: powershell | |
run: | | |
$cudaPath = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${{ matrix.cuda_version }}" | |
$cudaVersionEnv = "${{ matrix.cuda_version }}".Replace('.', '_') | |
echo "$cudaPath\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
echo "CUDA_PATH=$cudaPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
echo "CUDA_PATH_V$cudaVersionEnv=$cudaPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
# Cache vcpkg installation and dependencies | |
- name: Cache vcpkg | |
id: cache-vcpkg | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ runner.workspace }}/vcpkg | |
vcpkg_installed | |
key: vcpkg-${{ hashFiles('**/vcpkg.json', '.github/workflows/continuous-integration.yml') }}-${{ runner.os }} | |
restore-keys: | | |
vcpkg- | |
- name: Set up vcpkg | |
if: steps.cache-vcpkg.outputs.cache-hit != 'true' | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgDirectory: '${{ runner.workspace }}/vcpkg' | |
vcpkgGitCommitId: 'f7423ee180c4b7f40d43402c2feb3859161ef625' | |
vcpkgJsonGlob: 'vcpkg.json' | |
- name: Build Release Configuration | |
uses: ./.github/actions/build-config | |
with: | |
build-type: 'Release' | |
platform: 'windows' | |
vcpkg-root: '${{ runner.workspace }}/vcpkg' | |
workspace-dir: '${{ github.workspace }}' | |
- name: Build Debug Configuration | |
uses: ./.github/actions/build-config | |
with: | |
build-type: 'Debug' | |
platform: 'windows' | |
vcpkg-root: '${{ runner.workspace }}/vcpkg' | |
workspace-dir: '${{ github.workspace }}' |