Use ghcr.io for images and a Minikube or Colima cluster. #2497
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Integration Tests" | |
on: | |
pull_request_target: | |
types: | |
- labeled | |
env: | |
KUBECONFIG: ${{ github.workspace }}/kubeconfig.yaml | |
DTEST_KUBECONFIG: ${{ github.workspace }}/kubeconfig.yaml | |
TELEPRESENCE_REGISTRY: localhost:5000 | |
DTEST_REGISTRY: localhost:5000 | |
SCOUT_DISABLE: "1" | |
jobs: | |
build_image: | |
if: ${{ github.event.label.name == 'ok to test' }} | |
runs-on: ubuntu-latest | |
outputs: | |
telepresenceVersion: ${{ steps.build.outputs.version }} | |
steps: | |
- name: Remove label | |
uses: buildsville/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
labels: ok to test | |
type: remove | |
- uses: actions/checkout@v4 | |
with: | |
ref: "${{ github.event.pull_request.head.sha }}" | |
fetch-depth: 0 | |
show-progress: false | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
- name: Build dev image | |
id: build | |
run: | | |
make save-tel2-image | |
echo "version=$(cat build-output/version.txt)" >> $GITHUB_OUTPUT | |
- name: Upload image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: image | |
path: build-output/tel2-image.tar | |
run_tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
runners: | |
- ubuntu-latest | |
- ubuntu-arm64 | |
- macos-13 # Ensure amd64 (see https://github.com/marketplace/actions/setup-docker-on-macos) | |
- windows-latest | |
runs-on: ${{ matrix.runners }} | |
needs: build_image | |
steps: | |
- name: Create k8s Kind Cluster | |
uses: helm/kind-action@v1 | |
with: | |
config: ${{ env.KUBECONFIG }} | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: "${{ github.event.pull_request.head.sha }}" | |
- name: install dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Build client | |
env: | |
TELEPRESENCE_VERSION: ${{needs.build_image.outputs.telepresenceVersion}} | |
run: make build | |
- name: Build client image | |
if: runner.os == 'Linux' | |
env: | |
TELEPRESENCE_VERSION: ${{needs.build_image.outputs.telepresenceVersion}} | |
run: make client-image | |
- name: Download prebuilt docker image | |
uses: actions/download-artifact@v3 | |
with: | |
name: image | |
- name: Upload docker image to cluster | |
shell: bash | |
run: | | |
kubectl apply -f build-aux/image-importer.yaml | |
kubectl rollout status -w deployment/image-importer | |
POD_NAME=$(kubectl get pod -ojsonpath='{.items[0].metadata.name}' -l app=image-importer) | |
kubectl cp tel2-image.tar "$POD_NAME:/tmp/image.tar" | |
kubectl exec $POD_NAME -- //hostbin/ctr images import //tmp/image.tar | |
- name: Run integration tests | |
env: | |
DEV_TELEPRESENCE_VERSION: ${{needs.build_image.outputs.telepresenceVersion}} | |
TELEPRESENCE_VERSION: ${{needs.build_image.outputs.telepresenceVersion}} | |
uses: nick-fields/retry/@v3 | |
with: | |
max_attempts: 3 | |
shell: bash | |
timeout_minutes: 90 | |
command: | | |
set -ex | |
if [[ ${RUNNER_OS} == "Windows" ]]; then | |
export PATH="$PATH:/C/Program Files/SSHFS-Win/bin" | |
fi | |
make check-integration | |
- uses: ./.github/actions/upload-logs | |
env: | |
LOG_SUFFIX: "${{ runner.os }}-${{ runner.arch }}-${{ matrix.clusters.distribution }}-${{ matrix.clusters.version }}" | |
if: always() |