Files
OpenShell/.github/workflows/e2e-test.yml

86 lines
2.8 KiB
YAML

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: "linux-amd64-cpu8"
checkout-ref:
description: "Git ref to check out for test inputs (defaults to the workflow SHA)"
required: false
type: string
default: ""
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
cmd: "mise run --no-deps --skip-deps e2e:python"
apt_packages: ""
- suite: rust-docker
cmd: "mise run --no-deps --skip-deps e2e:rust"
apt_packages: "openssh-client"
- suite: rust-podman
cmd: "mise run --no-deps --skip-deps e2e:podman"
apt_packages: "openssh-client podman"
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
- /home/runner/_work:/home/runner/_work
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 }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs['checkout-ref'] || github.sha }}
- name: Install OS test dependencies
if: matrix.apt_packages != ''
env:
APT_PACKAGES: ${{ matrix.apt_packages }}
run: apt-get update && apt-get install -y ${APT_PACKAGES} && rm -rf /var/lib/apt/lists/*
- name: Log in to GHCR with Docker
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Log in to GHCR with Podman
if: matrix.suite == 'rust-podman'
run: echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Install Python dependencies and generate protobuf stubs
if: matrix.suite == 'python'
run: uv sync --frozen && mise run --no-deps python:proto
- name: Run tests
env:
OPENSHELL_SUPERVISOR_IMAGE: ${{ format('ghcr.io/nvidia/openshell/supervisor:{0}', inputs.image-tag) }}
run: ${{ matrix.cmd }}