Skip to content

Nightly VTK master

Nightly VTK master #13

name: Nightly VTK master
on:
schedule:
- cron: '0 0 * * *'
jobs:
#----------------------------------------------------------------------------
# Check nightly: Checkout VTK and check if the last merged commit is less than 24 hours old
#----------------------------------------------------------------------------
check_nightly:
if: github.repository == 'f3d-app/f3d'
runs-on: ubuntu-latest
name: Check nightly
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
vtk_sha: ${{ steps.vtk_sha_recover.outputs.vtk_sha }}
steps:
- name: Checkout VTK
uses: actions/checkout@v4
with:
repository: Kitware/VTK
submodules: false
fetch-depth: 0
ref: master
- name: Check latest commit age is less than 24 hours
id: should_run
run: test -n "$(git rev-list --no-merges HEAD --not $(git rev-list -n1 --before=24hours --first-parent HEAD))" && echo "should_run=true" >> $GITHUB_OUTPUT || echo "should_run=false" >> $GITHUB_OUTPUT
- name: Set VTK sha env var
id: vtk_sha_recover
shell: bash
run: echo "vtk_sha=$(git log -n 1 --pretty=format:%H)" >> $GITHUB_OUTPUT
#----------------------------------------------------------------------------
# Cache LFS: Checkout LFS data and update the cache to limit LFS bandwidth
#----------------------------------------------------------------------------
cache_lfs:
needs: check_nightly
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
runs-on: ubuntu-latest
name: Update LFS data cache
outputs:
lfs_sha: ${{ steps.lfs_sha_recover.outputs.lfs_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
lfs: false
- name: Set LFS env var
working-directory: ${{github.workspace}}/source
id: lfs_sha_recover
shell: bash
run: echo "lfs_sha=$(git log -n 1 --pretty=format:%H -- testing/data/ testing/baselines/ examples/**/*/data/ examples/**/*/baselines/ .github/baselines/)" >> $GITHUB_OUTPUT
- name: Copy LFS Data
uses: ./source/.github/actions/lfs-copy
with:
lfs_sha: ${{ steps.lfs_sha_recover.outputs.lfs_sha }}
workflow_label: 'producer'
#----------------------------------------------------------------------------
# Windows CI: Build and test
#----------------------------------------------------------------------------
windows:
needs: [cache_lfs, check_nightly]
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
lfs: false
- name: Generic CI
uses: ./source/.github/actions/generic-ci
with:
vtk_version: ${{needs.check_nightly.outputs.vtk_sha}}
raytracing_label: 'raytracing'
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}
#----------------------------------------------------------------------------
# Linux CI: Build and test
#----------------------------------------------------------------------------
linux:
needs: [cache_lfs, check_nightly]
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
matrix:
build_type: [standard]
include:
- egl_label: no-egl
- build_type: headless
egl_label: egl
runs-on: ubuntu-latest
container: ghcr.io/f3d-app/f3d-ci
env:
DISPLAY: :0
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
lfs: false
- name: Generic CI
uses: ./source/.github/actions/generic-ci
with:
build_type: ${{matrix.build_type}}
vtk_version: ${{needs.check_nightly.outputs.vtk_sha}}
raytracing_label: 'raytracing'
exclude_deprecated_label: ${{matrix.exclude_deprecated_label}}
egl_label: ${{matrix.egl_label}}
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}
#----------------------------------------------------------------------------
# MacOS CI: Build and test
#----------------------------------------------------------------------------
macos:
needs: [cache_lfs, check_nightly]
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
lfs: false
- name: Generic CI
uses: ./source/.github/actions/generic-ci
with:
vtk_version: ${{needs.check_nightly.outputs.vtk_sha}}
cpu: x86_64
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}
#----------------------------------------------------------------------------
# MacOS arm64 CI: Build and test
#----------------------------------------------------------------------------
macos_arm:
needs: [cache_lfs, check_nightly]
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
lfs: false
- name: Generic CI
uses: ./source/.github/actions/generic-ci
with:
vtk_version: ${{needs.check_nightly.outputs.vtk_sha}}
cpu: arm64
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}
#----------------------------------------------------------------------------
# Sanitizer: Build and test on linux with last VTK with sanitizer options
#----------------------------------------------------------------------------
# "leak" is run by default with "address" so we do not need to run it in CI
# "memory" returns false positives in VTK:
# https://stackoverflow.com/questions/60097307/memory-sanitizer-reports-use-of-uninitialized-value-in-global-object-constructio
sanitizer:
needs: [cache_lfs, check_nightly]
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
matrix:
sanitizer_type: [address, thread, undefined]
runs-on: ubuntu-latest
container: ghcr.io/f3d-app/f3d-ci
env:
DISPLAY: :0
CC: clang
CXX: clang++
VTK_SMP_BACKEND_IN_USE: Sequential
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
lfs: false
- name: Sanitizer CI
uses: ./source/.github/actions/sanitizer-ci
with:
vtk_version: ${{needs.check_nightly.outputs.vtk_sha}}
sanitizer_type: ${{matrix.sanitizer_type}}
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}
#----------------------------------------------------------------------------
# android: Check build of F3D for android
#----------------------------------------------------------------------------
android:
needs: check_nightly
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
matrix:
arch: [armeabi-v7a, arm64-v8a, x86, x86_64]
runs-on: ubuntu-latest
container: ghcr.io/f3d-app/f3d-ci
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
lfs: false
- name: Android CI
uses: ./source/.github/actions/android-ci
with:
arch: ${{matrix.arch}}
vtk_version: ${{needs.check_nightly.outputs.vtk_sha}}
#----------------------------------------------------------------------------
# webassembly: Check build of F3D for webassembly
#----------------------------------------------------------------------------
webassembly:
needs: check_nightly
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
runs-on: ubuntu-latest
container: dockcross/web-wasm:20230905-7b2d74f
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
lfs: 'false'
- name: Web Assembly CI
uses: ./source/.github/actions/webassembly-ci
with:
vtk_version: ${{needs.check_nightly.outputs.vtk_sha}}