-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 3.62 KB
/
ci.yml
File metadata and controls
97 lines (83 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: CI
on:
pull_request:
push:
branches: [main, develop]
env:
BUILD_TYPE: Release
EMBREE_VERSION: 4.4.0
TBB_VERSION: 2021.11.0
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Linux dependencies
if: startsWith(matrix.os, 'ubuntu-')
run: |
sudo apt update
sudo apt install -y qt6-base-dev libgl1-mesa-dev
- name: Linux Embree and TBB
if: startsWith(matrix.os, 'ubuntu-')
run: |
mkdir -p deps/embree
curl -L "https://github.com/RenderKit/embree/releases/download/v${{ env.EMBREE_VERSION }}/embree-${{ env.EMBREE_VERSION }}.x86_64.linux.tar.gz" -o deps/embree.tgz
tar xf deps/embree.tgz -C deps/embree
curl -L "https://github.com/uxlfoundation/oneTBB/releases/download/v${{ env.TBB_VERSION }}/oneapi-tbb-${{ env.TBB_VERSION }}-lin.tgz" -o deps/tbb.tgz
tar xf deps/tbb.tgz -C deps
echo "CMAKE_PREFIX_PATH=${PWD}/deps/embree;${PWD}/deps/oneapi-tbb-${{ env.TBB_VERSION }}" >> $GITHUB_ENV
- name: macOS Qt
if: startsWith(matrix.os, 'macos-')
uses: jurplel/install-qt-action@v4
with:
version: 6.7.0
- name: macOS dependencies
if: startsWith(matrix.os, 'macos-')
run: |
brew update
brew install embree tbb
PREFIXES="$(brew --prefix embree);$(brew --prefix tbb)"
if [ -n "${Qt6_DIR}" ]; then
PREFIXES="${PREFIXES};${Qt6_DIR}"
fi
echo "CMAKE_PREFIX_PATH=${PREFIXES}" >> $GITHUB_ENV
- name: Windows MSVC
if: startsWith(matrix.os, 'windows-')
uses: ilammy/msvc-dev-cmd@v1
- name: Windows Qt
if: startsWith(matrix.os, 'windows-')
uses: jurplel/install-qt-action@v4
with:
version: 6.7.0
- name: Windows Embree and TBB
if: startsWith(matrix.os, 'windows-')
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$deps = Join-Path $env:GITHUB_WORKSPACE "deps"
New-Item -ItemType Directory -Force -Path $deps | Out-Null
$embreeZip = Join-Path $deps "embree.zip"
Invoke-WebRequest "https://github.com/RenderKit/embree/releases/download/v${{ env.EMBREE_VERSION }}/embree-${{ env.EMBREE_VERSION }}.x64.windows.zip" -OutFile $embreeZip
$embreeRoot = Join-Path $deps "embree"
New-Item -ItemType Directory -Force -Path $embreeRoot | Out-Null
Expand-Archive -Path $embreeZip -DestinationPath $embreeRoot -Force
$tbbZip = Join-Path $deps "tbb.zip"
Invoke-WebRequest "https://github.com/uxlfoundation/oneTBB/releases/download/v${{ env.TBB_VERSION }}/oneapi-tbb-${{ env.TBB_VERSION }}-win.zip" -OutFile $tbbZip
Expand-Archive -Path $tbbZip -DestinationPath $deps -Force
$prefixes = @($embreeRoot, (Join-Path $deps "oneapi-tbb-${{ env.TBB_VERSION }}"))
if ($env:Qt6_DIR) { $prefixes += $env:Qt6_DIR }
"CMAKE_PREFIX_PATH=$($prefixes -join ';')" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding ascii
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_PREFIX_PATH="${{ env.CMAKE_PREFIX_PATH }}"
- name: Build
run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel
- name: Test
run: ctest --test-dir build --output-on-failure --build-config ${{ env.BUILD_TYPE }}