Repository navigation
137 lines (116 loc) · 4.33 KB
/
Copy pathconformance.yml
File metadata and controls
137 lines (116 loc) · 4.33 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
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Conformance
on:
workflow_call:
inputs:
scenarios:
description: JSON array of tmachine scenarios to run
required: true
type: string
testsuites:
description: JSON array of tmachine test suites to run
required: true
type: string
permissions:
actions: read
contents: read
concurrency:
group: ${{ github.workflow }}-conformance-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:
name: Prepare conformance inputs
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.sha }}
- uses: ./.github/actions/setup-nix
- name: Download CLI artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: openshell-x86_64-unknown-linux-musl
path: artifacts/binaries/x86_64-unknown-linux-musl
- name: Download gateway artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: openshell-gateway-x86_64-unknown-linux-gnu
path: artifacts/binaries/x86_64-unknown-linux-gnu
- name: Download sandbox image artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: image-sandbox
path: image-input/sandbox
- name: Download supervisor image artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: image-supervisor
path: image-input/supervisor
- name: Convert runtime images
shell: nix develop .#testing -c bash -euo pipefail {0}
run: |
mkdir -p artifacts/images
skopeo copy \
--override-os linux \
--override-arch amd64 \
oci-archive:image-input/sandbox/images/sandbox.tar \
docker-archive:artifacts/images/openshell-sandbox-tmachine.tar:openshell/sandbox:tmachine
skopeo copy \
--override-os linux \
--override-arch amd64 \
oci-archive:image-input/supervisor/images/supervisor.tar \
docker-archive:artifacts/images/openshell-supervisor-tmachine.tar:openshell/supervisor:tmachine
- name: Build conformance test archive
run: nix run .#build-artifacts-test-archives
- name: Upload conformance inputs
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: openshell-conformance-inputs
path: artifacts
compression-level: 0
retention-days: 5
if-no-files-found: error
conformance:
name: Conformance (${{ matrix.scenario }}, ${{ matrix.testsuite }})
needs: prepare
strategy:
fail-fast: false
matrix:
scenario: ${{ fromJSON(inputs.scenarios) }}
testsuite: ${{ fromJSON(inputs.testsuites) }}
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.sha }}
- name: Enable KVM access
run: |
set -euo pipefail
if [[ ! -c /dev/kvm ]]; then
echo "::error::The runner did not expose /dev/kvm"
exit 1
fi
sudo chmod 0666 /dev/kvm
exec 3<>/dev/kvm
exec 3>&-
- uses: ./.github/actions/setup-nix
- name: Cache tmachine disks
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: ~/.cache/tmachine
key: tmachine-${{ runner.os }}-${{ runner.arch }}
- name: Download conformance inputs
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: openshell-conformance-inputs
path: artifacts
- name: Run conformance
env:
SCENARIO: ${{ matrix.scenario }}
TESTSUITE: ${{ matrix.testsuite }}
run: nix run .#tmachine -- test "${SCENARIO}" "${TESTSUITE}"