Skip to content

Commit c28309b

Browse files
committed
Adding fVDB unit tests action
Signed-off-by: Jonathan Swartz <[email protected]>
1 parent 975beec commit c28309b

File tree

1 file changed

+152
-0
lines changed

1 file changed

+152
-0
lines changed

.github/workflows/fvdb.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
2+
name: fVDB
3+
4+
on:
5+
push:
6+
branches:
7+
- 'master'
8+
- 'feature/**'
9+
- 'pr/**'
10+
paths-ignore:
11+
- 'CHANGES'
12+
- 'CODEOWNERS'
13+
- 'doc/**'
14+
- 'openvdb_ax/**'
15+
- 'openvdb_maya/**'
16+
- 'openvdb_houdini/**'
17+
- 'pendingchanges/**'
18+
- '**.md'
19+
pull_request:
20+
branches:
21+
- '**'
22+
paths-ignore:
23+
- 'CHANGES'
24+
- 'CODEOWNERS'
25+
- 'doc/**'
26+
- 'openvdb_ax/**'
27+
- 'openvdb_maya/**'
28+
- 'openvdb_houdini/**'
29+
- 'pendingchanges/**'
30+
- '**.md'
31+
schedule:
32+
# run this workflow every day 7am UTC
33+
- cron: '0 7 * * *'
34+
workflow_dispatch:
35+
inputs:
36+
type:
37+
description: 'The type of CI to run (all, linux, win, mac)'
38+
required: true
39+
default: 'linux'
40+
41+
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
42+
concurrency:
43+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
44+
cancel-in-progress: true
45+
46+
jobs:
47+
linux-fvdb-build:
48+
if: |
49+
github.event_name != 'workflow_dispatch' ||
50+
github.event.inputs.type == 'all' ||
51+
github.event.inputs.type == 'linux'
52+
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-8c-32g-300h') || 'ubuntu-latest' }}
53+
name: >
54+
linux-fvdb-build:cxx:${{ matrix.config.cxx }}-${{ matrix.config.build }}
55+
container:
56+
image: aswf/ci-openvdb:${{ matrix.config.image }}
57+
env:
58+
CXX: ${{ matrix.config.cxx }}
59+
strategy:
60+
matrix:
61+
config:
62+
- { cxx: g++, image: '2022-clang11', build: 'Release' }
63+
- { cxx: g++, image: '2022-clang11', build: 'Debug' }
64+
- { cxx: clang++, image: '2022-clang11', build: 'Release' }
65+
- { cxx: clang++, image: '2022-clang11', build: 'Debug' }
66+
fail-fast: false
67+
steps:
68+
- uses: actions/checkout@v3
69+
70+
- name: Set up fvdb_test Conda env
71+
uses: conda-incubator/setup-miniconda@v3
72+
with:
73+
miniconda-version: "latest"
74+
mamba-version: "*"
75+
channels: conda-forge
76+
channel-priority: true
77+
activate-environment: fvdb_test
78+
environment-file: fvdb/env/test_environment.yml
79+
80+
- name: Build fvdb
81+
run: |
82+
conda activate fvdb_test
83+
TORCH_CUDA_ARCH_LIST="6.1;7.0;7.5;8.0;8.6+PTX" MAX_JOBS=$(($(nproc) < $(free -g | awk '/^Mem:/{jobs=int($4/2.5); if(jobs<1) jobs=1; print jobs}') ? $(nproc) : $(free -g | awk '/^Mem:/{jobs=int($4/2.5); if(jobs<1) jobs=1; print jobs}'))) python fvdb/setup.py bdist_wheel --dist-dir=dist
84+
shell:
85+
bash -el {0}
86+
87+
- name: Upload package
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: fvdb-package-${{ matrix.config.cxx }}-${{ matrix.config.build }}
91+
path: dist/
92+
93+
- name: Clean Conda
94+
run: |
95+
conda clean -pty
96+
shell:
97+
bash -el {0}
98+
99+
linux-fvdb-test:
100+
needs: [linux-fvdb-build]
101+
if: |
102+
github.event_name != 'workflow_dispatch' ||
103+
github.event.inputs.type == 'all' ||
104+
github.event.inputs.type == 'linux'
105+
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-gpu-t4-4c-16g-178h') || 'ubuntu-latest' }}
106+
name: >
107+
linux-fvdb-test:cxx:${{ matrix.config.cxx }}-${{ matrix.config.build }}
108+
container:
109+
image: aswf/ci-openvdb:${{ matrix.config.image }}
110+
env:
111+
CXX: ${{ matrix.config.cxx }}
112+
strategy:
113+
matrix:
114+
config:
115+
- { cxx: g++, image: '2022-clang11', build: 'Release' }
116+
- { cxx: g++, image: '2022-clang11', build: 'Debug' }
117+
- { cxx: clang++, image: '2022-clang11', build: 'Release' }
118+
- { cxx: clang++, image: '2022-clang11', build: 'Debug' }
119+
fail-fast: false
120+
steps:
121+
- uses: actions/checkout@v3
122+
123+
- name: Set up fvdb_test Conda env
124+
uses: conda-incubator/setup-miniconda@v3
125+
with:
126+
miniconda-version: "latest"
127+
mamba-version: "*"
128+
channels: conda-forge
129+
channel-priority: true
130+
activate-environment: fvdb_test
131+
environment-file: fvdb/env/test_environment.yml
132+
133+
- name: Download package
134+
uses: actions/download-artifact@v4
135+
with:
136+
name: fvdb-package-${{ matrix.config.cxx }}-${{ matrix.config.build }}
137+
- name: Install package
138+
run: |
139+
python -m pip install dist/*.whl
140+
141+
- name: Run tests
142+
run: |
143+
conda activate fvdb_test
144+
pytest -v fvdb/tests/unit
145+
shell:
146+
bash -el {0}
147+
148+
- name: Clean Conda
149+
run: |
150+
conda clean -pty
151+
shell:
152+
bash -el {0}

0 commit comments

Comments
 (0)