-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
82 lines (74 loc) · 2.76 KB
/
.gitlab-ci.yml
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
# -----------------------------------------------------------------------------
# Rule templates
# -----------------------------------------------------------------------------
# Rule to trigger on merge requests and updates to default branch
.default-rules:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'schedule'
# -----------------------------------------------------------------------------
# Job templates
# -----------------------------------------------------------------------------
# Windows (initializes conda environment then runs ci.py script)
.windows-base:
stage: build
tags:
- windows
- gpu
variables:
CONDA_PATH: C:\Users\NvrGfxTest\FalcorMiniconda
CONDA_ENV: falcor2
script:
# Setup conda environment
- Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
- |
& $CONDA_PATH\shell\condabin\conda-hook.ps1
- $condaEnvExists = conda env list | Select-String -Pattern "^\s*$CONDA_ENV\s"
- if (-not $condaEnvExists) { conda create -n $CONDA_ENV -y python=3.10 }
- conda activate $CONDA_ENV
# Run CI script
- python -u .build_agent/ci.py dependencies
- python -u .build_agent/ci.py precommit
- python -u .build_agent/ci.py install
- python -u .build_agent/ci.py test --device=vulkan --emulated
- python -u .build_agent/ci.py test --device=vulkan
- python -u .build_agent/ci.py test --device=d3d12 --emulated
- python -u .build_agent/ci.py test --device=d3d12
#Linux (initializes conda environment then runs ci.py script)
.linux-base:
stage: build
tags:
- linux
- gpu
variables:
CONDA_PATH: /home/gitlab-runner/FalcorMiniconda
CONDA_ENV: falcor2
script:
# Setup conda environment
- source ${CONDA_PATH}/bin/activate
- if conda env list | grep -q "^${CONDA_ENV}\s"; then
echo "Conda environment '${CONDA_ENV}' already exists.";
else
echo "Conda environment '${CONDA_ENV}' does not exist. Creating it...";
conda create --name ${CONDA_ENV} python=3.10 -y;
echo "Conda environment '${CONDA_ENV}' created successfully.";
fi
- conda activate ${CONDA_ENV}
# Run CI script
- python -u .build_agent/ci.py dependencies
- python -u .build_agent/ci.py precommit
- python -u .build_agent/ci.py install
- python -u .build_agent/ci.py test --device=vulkan --emulated
- python -u .build_agent/ci.py test --device=vulkan
# -----------------------------------------------------------------------------
# Standard build job
# -----------------------------------------------------------------------------
windows:
extends:
- .default-rules
- .windows-base
linux:
extends:
- .default-rules
- .linux-base