Skip to content

ci: add integration tests on GHA #18

ci: add integration tests on GHA

ci: add integration tests on GHA #18

Workflow file for this run

name: Images
on:
push:
branches: [main]
paths:
- 'sandbox/**'
- 'profiles/**'
- 'providers.toml'
tags: ["v*"]
pull_request:
paths:
- 'sandbox/**'
- 'profiles/**'
- 'providers.toml'
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_BASE: ghcr.io/${{ github.repository }}
jobs:
sandbox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.IMAGE_BASE }}
tags: |
type=raw,value=sandbox,enable={{is_default_branch}}
type=semver,pattern=sandbox-v{{version}}
type=ref,event=pr,prefix=sandbox-pr-
- uses: docker/build-push-action@v6
with:
context: sandbox
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=registry,ref=${{ env.IMAGE_BASE }}:sandbox-cache
type=registry,ref=${{ env.IMAGE_BASE }}:sandbox
cache-to: type=registry,ref=${{ env.IMAGE_BASE }}:sandbox-cache,mode=max
launcher:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build launcher binary
run: cd sandbox/launcher && GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o launcher .
- name: Install openshell CLI
run: |
curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | sh
cp "$(which openshell)" sandbox/launcher/openshell
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.IMAGE_BASE }}
tags: |
type=raw,value=launcher,enable={{is_default_branch}}
type=semver,pattern=launcher-v{{version}}
type=ref,event=pr,prefix=launcher-pr-
- uses: docker/build-push-action@v6
with:
context: sandbox/launcher
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=registry,ref=${{ env.IMAGE_BASE }}:launcher-cache
type=registry,ref=${{ env.IMAGE_BASE }}:launcher
cache-to: type=registry,ref=${{ env.IMAGE_BASE }}:launcher-cache,mode=max