-
Notifications
You must be signed in to change notification settings - Fork 8
88 lines (80 loc) · 2.51 KB
/
unit_test.yaml
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
name: Unit test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "trunk"
workflow_dispatch:
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
build_test:
name: Unit test [py${{ matrix.python }} ${{ matrix.os }}]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
python: ['39', '310', '311', '312', '313']
include:
# Render gallery images in one configuration
- os: 'ubuntu-24.04'
python: '313'
render_gallery: true
# Test macOS and windows on oldest and latest versions.
- os: 'macos-14'
python: '313'
- os: 'windows-2022'
python: '313'
cmake_generator: "Visual Studio 17 2022"
- os: 'windows-2022'
python: '39'
cmake_generator: "Visual Studio 17 2022"
- os: 'windows-2019'
python: '39'
cmake_generator: "Visual Studio 16 2019"
- os: 'macos-14'
python: '39'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: code
submodules: true
- name: Create Python Environment
uses: mamba-org/setup-micromamba@617811f69075e3fd3ae68ca64220ad065877f246 # v2.0.0
with:
micromamba-version: '2.0.2-2'
environment-name: test
environment-file: code/.github/workflows/environments/py${{ matrix.python }}-conda-lock.yml
- name: Configure
run: >
cmake -S code -B build
-DENABLE_EMBREE=ON
-DENABLE_OPTIX=OFF
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON
env:
CMAKE_PREFIX_PATH: ${{ github.workspace }}\env
- name: Build
run: cmake --build build --config Release -j
- name: Install
run: cmake --install build --config Release
- name: Run tests
run: python -m pytest --pyargs fresnel -v --log-level=DEBUG --durations=0 --durations-min=0.1
- name: Render gallery images
if: ${{ matrix.render_gallery }}
run: for i in *.py; do echo "Rendering $i" && python3 $i || exit 1; done
working-directory: code/doc/gallery
# This job is used to provide a single requirement for branch merge conditions.
tests_complete:
name: Unit test
if: always()
needs: [build_test]
runs-on: ubuntu-latest
steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
- name: Done
run: echo "Done."