Repository navigation
186 lines (170 loc) · 6.57 KB
/
Copy pathtest.yml
File metadata and controls
186 lines (170 loc) · 6.57 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
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# 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.
name: Test
on:
workflow_call:
inputs:
platform:
required: true
type: string
config:
required: true
type: string
suite:
required: true
type: string
bucket:
required: false
type: string
default: ""
coverage:
required: false
type: boolean
default: false
jobs:
test:
name: "Test (${{ inputs.suite }}${{ inputs.bucket != '' && format(':{0}', inputs.bucket) || '' }})"
runs-on: [self-hosted, gpu]
timeout-minutes: 120
defaults:
run:
shell: bash
env:
OMNI_KIT_ALLOW_ROOT: 1
NVIDIA_VISIBLE_DEVICES: all
NVIDIA_DRIVER_CAPABILITIES: all
CUDA_HOME: /usr/local/cuda
LD_LIBRARY_PATH: /usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
DISPLAY: ':0'
GITLAB_CI: gitlab
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Make repo scripts executable
run: |
chmod -R u+w .
find . -type f -iname "*.sh" -exec chmod +x {} +
- name: Download packaged artifacts
uses: actions/download-artifact@v4
with:
name: isaac-sim-packages-${{ inputs.platform }}-${{ inputs.config }}${{ inputs.coverage && '-cov' || '' }}
path: _build/packages/
- name: Verify downloaded artifacts against build manifest
run: |
set -euo pipefail
echo "=== Verifying artifact integrity ==="
manifest="_build/packages/artifact-manifest.txt"
if [ ! -f "$manifest" ]; then
echo "::error::No artifact-manifest.txt found — build may not include manifest yet"
echo "Falling back to basic existence check"
mapfile -t archives < <(find _build/packages/ -name '*.7z' -o -name '*.zip')
if [ ${#archives[@]} -eq 0 ]; then
echo "::error::No archives found in _build/packages/"
exit 1
fi
for archive in "${archives[@]}"; do
echo " $(basename "$archive") size=$(stat -c%s "$archive") sha256=$(sha256sum "$archive" | cut -d' ' -f1)"
done
exit 0
fi
echo "Manifest contents:"
cat "$manifest"
echo "---"
errors=0
while IFS= read -r line; do
[ -z "$line" ] && continue
expected_sha=$(echo "$line" | awk '{print $1}')
expected_size=$(echo "$line" | awk '{print $2}')
filename=$(echo "$line" | awk '{print $3}')
# Find the file on disk
actual_file=$(find _build/packages/ -name "$filename" -print -quit)
if [ -z "$actual_file" ]; then
echo "::error::Manifest lists $filename but file not found on disk"
errors=$((errors + 1))
continue
fi
actual_size=$(stat -c%s "$actual_file")
actual_sha=$(sha256sum "$actual_file" | cut -d' ' -f1)
if [ "$actual_size" != "$expected_size" ] || [ "$actual_sha" != "$expected_sha" ]; then
echo "::error::MISMATCH: $filename"
echo " expected: size=$expected_size sha256=$expected_sha"
echo " actual: size=$actual_size sha256=$actual_sha"
if [ "$actual_size" != "$expected_size" ]; then
diff_bytes=$((expected_size - actual_size))
echo " size difference: $diff_bytes bytes"
fi
errors=$((errors + 1))
else
echo " OK: $filename size=$actual_size sha256=$actual_sha"
fi
done < "$manifest"
if [ "$errors" -gt 0 ]; then
echo "::error::$errors artifact(s) failed integrity check — download was corrupted"
echo "=== Disk usage (df -h) ==="
df -h
echo "=== _build/packages/ listing ==="
ls -lah _build/packages/
exit 1
fi
echo "All artifacts verified against build manifest ✓"
- name: Run tests
env:
TEST_BUCKET: ${{ inputs.bucket }}
TEST_CONFIG: ${{ inputs.config }}
TEST_SUITE: ${{ inputs.suite }}
run: |
set -euo pipefail
set -x
touch .eula_accepted
BUCKET_ARGS=()
if [ -n "${TEST_BUCKET}" ]; then
BUCKET_ARGS=(-b "${TEST_BUCKET}")
fi
echo "::group::Test ${TEST_SUITE} ${TEST_BUCKET}"
./repo.sh test -c "${TEST_CONFIG}" -s "${TEST_SUITE}" "${BUCKET_ARGS[@]}" --from-package \
--extra-arg="--/rtx-transient/ngx/enabled=false"
echo "::endgroup::"
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ inputs.suite }}-${{ inputs.bucket || 'all' }}
path: |
_build/packages/*/_testoutput/**
_build/packages/*/kit/logs/**
_build/packages/*/portable_root/logs/**
retention-days: 7
if: always()
- name: Collect coverage data
if: always() && inputs.coverage
run: |
set -x
echo "=== Collecting coverage artifacts ==="
mkdir -p _coverage_output
# Collect C++ coverage data (.gcda files produced during test execution)
find . -name "*.gcda" -not -path "./.git/*" -exec cp --parents {} _coverage_output/ \; 2>/dev/null || true
GCDA_COUNT=$(find _coverage_output -name "*.gcda" 2>/dev/null | wc -l)
echo "Found $GCDA_COUNT .gcda files"
du -sh _coverage_output/ 2>/dev/null || true
- name: Upload coverage artifacts
if: always() && inputs.coverage
uses: actions/upload-artifact@v4
with:
name: coverage-${{ inputs.suite }}-${{ inputs.bucket || 'all' }}
path: _coverage_output/
retention-days: 7
if-no-files-found: warn