forked from newton-physics/newton
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
211 lines (195 loc) · 6.01 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
211 lines (195 loc) · 6.01 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# SPDX-FileCopyrightText: Copyright (c) 2025 The Newton Developers
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# Default pipeline configuration
# ==============================================================================
default:
interruptible: true
# Only retry on GitLab failures (not on script failures for example)
retry:
max: 2
when:
- api_failure
- runner_system_failure
- stuck_or_timeout_failure
- scheduler_failure
- unknown_failure
variables:
UV_LINK_MODE: copy
workflow:
rules:
- if: $CI_PROJECT_ROOT_NAMESPACE != "omniverse" # Prevent pipelines that can't access the runners
when: never
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_SHA
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
auto_cancel:
on_new_commit: none
on_job_failure: none
- if: $CI_COMMIT_TAG # Run for tagged releases
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- if: $CI_PIPELINE_SOURCE == "web" # Run if triggered from the UI
stages:
- lint
- test
- build
- docs
# ==============================================================================
# Include the Omniverse DevPlat runner job definitions
# ==============================================================================
include:
- project: "omniverse/devplat/gitlab/templates/runners"
file: "/modules/include.yml"
ref: v2_latest
# --- Stage: Lint ---
linting:
stage: lint
image: ghcr.io/astral-sh/uv:bookworm
extends:
- .omni_nvks_micro_runner
needs: []
script:
- uvx pre-commit run --all-files --show-diff-on-failure
# --- Stage: Test ---
.test_common:
stage: test
needs: []
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
when: always
paths:
- rspec.xml
- coverage.xml
reports:
junit: rspec.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
- .gitlab/ci/*
- .gitlab-ci.yml
- newton/**/*
- pyproject.toml
- .python-version
- uv.lock
- when: manual # If not auto-triggered, allow any pipeline to run this job manually
allow_failure: true
script:
- uv run --extra dev --extra torch-cu12 -m newton.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml
linux-x86_64 test:
image: ghcr.io/astral-sh/uv:bookworm
extends:
- .ipp_lnx_x86_64_gpu
- .test_common
# TODO: mujoco load dll often fails on Windows, disabling
.windows-x86_64 test:
extends:
- .test_common
needs: []
before_script:
- powershell -ExecutionPolicy ByPass -c {$env:UV_INSTALL_DIR = "${env:CI_PROJECT_DIR}\uv-install";irm https://astral.sh/uv/install.ps1 | iex}
- $env:Path = "${env:CI_PROJECT_DIR}\uv-install;$env:Path"
- uv venv --managed-python
allow_failure: true
tags:
- win-x86_64-gpu-1x-573.42
linux-x86_64 test warp nightly:
image: ghcr.io/astral-sh/uv:bookworm
extends:
- .ipp_lnx_x86_64_gpu
stage: test
needs: []
artifacts:
when: always
paths:
- rspec.xml
reports:
junit: rspec.xml
before_script:
- uv venv
- source .venv/bin/activate
- uv sync --extra dev --extra torch-cu12
- uv pip install -U --pre warp-lang
script:
- python -m newton.tests --junit-report-xml rspec.xml
allow_failure: true # TODO: Remove this after outstanding issues are resolved
# --- Stage: Build ---
build_package:
stage: build
image: ghcr.io/astral-sh/uv:bookworm
needs: []
extends:
- .ipp_lnx_x86_64_cpu_micro
script:
- uv build --wheel
- uvx twine check dist/*
artifacts:
paths:
- dist/
# --- Stage: Build Documentation ---
.build-docs-common:
stage: docs
image: ghcr.io/astral-sh/uv:bookworm
needs: []
extends:
- .ipp_lnx_x86_64_cpu_micro
artifacts:
paths:
- public
script:
- uv run --extra docs sphinx-build -W -b html docs docs/_build/html
- mv docs/_build/html/ ./public/
# Merge requests: Build documentation and save as an artifact
# A link to the generated documentation is added to the merge request.
merge request docs:
extends:
- .build-docs-common
artifacts:
paths:
- public
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
timeout: 10m
environment:
name: review/$CI_MERGE_REQUEST_IID
url: https://$CI_PROJECT_ROOT_NAMESPACE.$CI_PAGES_DOMAIN/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html
after_script:
- echo "View the website at https://$CI_PROJECT_ROOT_NAMESPACE.$CI_PAGES_DOMAIN/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html"
doctest:
stage: docs
image: ghcr.io/astral-sh/uv:bookworm
needs: []
extends:
- .ipp_lnx_x86_64_gpu
script:
- uv run --extra docs sphinx-build -W -b doctest docs docs/_build/doctest
# Build documentation and publish on gitlab-master
# This only runs in the default branch pipeline. The "pages" name is special for GitLab.
pages:
extends:
- .build-docs-common
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
timeout: 10m
environment:
name: GitLab Pages
deployment_tier: staging
url: $CI_PAGES_URL