-
Notifications
You must be signed in to change notification settings - Fork 474
90 lines (80 loc) · 2.9 KB
/
e2e-test.yml
File metadata and controls
90 lines (80 loc) · 2.9 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
name: E2E Test
on:
workflow_call:
inputs:
image-tag:
description: "Image tag to test (typically the commit SHA)"
required: true
type: string
runner:
description: "GitHub Actions runner label"
required: false
type: string
default: "build-amd64"
permissions:
contents: read
packages: read
jobs:
e2e:
name: "E2E (${{ matrix.suite }})"
runs-on: ${{ inputs.runner }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- suite: python
cluster: e2e-python
port: "8080"
cmd: "mise run --no-prepare --skip-deps e2e:python"
- suite: rust
cluster: e2e-rust
port: "8081"
cmd: "mise run --no-prepare --skip-deps e2e:rust"
- suite: gateway-resume
cluster: e2e-resume
port: "8082"
cmd: "cargo test --manifest-path e2e/rust/Cargo.toml --features e2e --test gateway_resume"
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
volumes:
- /var/run/docker.sock:/var/run/docker.sock
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_TAG: ${{ inputs.image-tag }}
OPENSHELL_REGISTRY: ghcr.io/nvidia/openshell
OPENSHELL_REGISTRY_HOST: ghcr.io
OPENSHELL_REGISTRY_NAMESPACE: nvidia/openshell
OPENSHELL_REGISTRY_USERNAME: ${{ github.actor }}
OPENSHELL_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
OPENSHELL_GATEWAY: ${{ matrix.cluster }}
steps:
- uses: actions/checkout@v4
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Pull cluster image
run: docker pull ghcr.io/nvidia/openshell/cluster:${{ inputs.image-tag }}
- name: Install Python dependencies and generate protobuf stubs
if: matrix.suite == 'python'
run: uv sync --frozen && mise run --no-prepare python:proto
- name: Build Rust CLI
if: matrix.suite != 'python'
run: cargo build -p openshell-cli --features openshell-core/dev-settings
- name: Install SSH client
if: matrix.suite != 'python'
run: apt-get update && apt-get install -y --no-install-recommends openssh-client && rm -rf /var/lib/apt/lists/*
- name: Bootstrap cluster
env:
GATEWAY_HOST: host.docker.internal
GATEWAY_PORT: ${{ matrix.port }}
CLUSTER_NAME: ${{ matrix.cluster }}
SKIP_IMAGE_PUSH: "1"
SKIP_CLUSTER_IMAGE_BUILD: "1"
OPENSHELL_CLUSTER_IMAGE: ghcr.io/nvidia/openshell/cluster:${{ inputs.image-tag }}
run: mise run --no-prepare --skip-deps cluster
- name: Run tests
run: ${{ matrix.cmd }}