Unify client configuration #2583
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: | |
TELEPRESENCE_REGISTRY: ghcr.io/telepresenceio | |
DTEST_REGISTRY: ghcr.io/telepresenceio | |
jobs: | |
build_images: | |
if: github.event.label.name == 'ok to test' | |
runs-on: ubuntu-latest | |
outputs: | |
telepresenceVersion: ${{ steps.version.outputs.version }} | |
telepresenceSemver: ${{ steps.version.outputs.semver }} | |
steps: | |
- name: Remove label | |
uses: buildsville/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
labels: ok to test | |
type: remove | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: "${{ github.event.pull_request.head.sha }}" | |
- name: Get Telepresence Version | |
id: version | |
run: | | |
v=$(go run build-aux/genversion/main.go ${{github.run_id}}) | |
echo "TELEPRESENCE_VERSION=$v" >> "$GITHUB_ENV" | |
echo "TELEPRESENCE_SEMVER=${v#v}" >> "$GITHUB_ENV" | |
echo "version=$v" >> $GITHUB_OUTPUT | |
echo "semver=${v#v}" >> $GITHUB_OUTPUT | |
- name: Setup docker buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
- name: Build image dependencies | |
run: make images-deps | |
- name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Push client image | |
run: | | |
docker buildx build --platform=linux/amd64,linux/arm64 --build-arg TELEPRESENCE_VERSION=${{env.TELEPRESENCE_SEMVER}} \ | |
--push --tag ${{env.TELEPRESENCE_REGISTRY}}/telepresence:${{env.TELEPRESENCE_SEMVER}} -f build-aux/docker/images/Dockerfile.client . | |
- name: Push tel2 image | |
run: | | |
docker buildx build --platform=linux/amd64,linux/arm64 --build-arg TELEPRESENCE_VERSION=${{env.TELEPRESENCE_SEMVER}} \ | |
--push --tag ${{env.TELEPRESENCE_REGISTRY}}/tel2:${{env.TELEPRESENCE_SEMVER}} -f build-aux/docker/images/Dockerfile.traffic . | |
- name: Log out from registry | |
if: always() | |
run: docker logout | |
run_tests: | |
if: github.event.label.name == 'ok to test' | |
strategy: | |
fail-fast: false | |
matrix: | |
runners: | |
- ubuntu-latest | |
# Re-enable when we can run a proper cluster. Colima almost works on macOS but the very limited | |
# resources available make the test fail very often. On windows, we'll need WSL2 | |
# - macos-latest | |
# - windows-latest | |
runs-on: ${{ matrix.runners }} | |
needs: build_images | |
env: | |
TELEPRESENCE_VERSION: ${{ needs.build_images.outputs.telepresenceVersion }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: "${{ github.event.pull_request.head.sha }}" | |
- name: install dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Start minikube | |
if: runner.os == 'Linux' | |
uses: medyagh/setup-minikube@latest | |
- name: Build client | |
run: make build | |
- name: Run integration tests | |
env: | |
SCOUT_DISABLE: "1" | |
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:$HOME/kubectl-plugins" | |
fi | |
DEV_TELEPRESENCE_VERSION=${TELEPRESENCE_VERSION} DTEST_KUBECONFIG="${HOME}/.kube/config" make check-integration | |
- uses: ./.github/actions/upload-logs | |
env: | |
LOG_SUFFIX: "${{ runner.os }}-${{ runner.arch }}-${{ matrix.clusters.distribution }}-${{ matrix.clusters.version }}" | |
if: always() | |
purge_images: | |
if: github.event.label.name == 'ok to test' | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
needs: | |
- build_images | |
- run_tests | |
steps: | |
- name: Delete tel2 and telepresence image | |
uses: dataaxiom/ghcr-cleanup-action@v1 | |
continue-on-error: true | |
if: always() | |
with: | |
owner: telepresenceio | |
packages: tel2,telepresence | |
token: ${{ secrets.GITHUB_TOKEN }} | |
delete-tags: ${{ needs.build_images.outputs.telepresenceSemver }} | |
- name: Prune tel2 and telepresence | |
uses: dataaxiom/ghcr-cleanup-action@v1 | |
with: | |
owner: telepresenceio | |
packages: tel2,telepresence | |
token: ${{ secrets.GITHUB_TOKEN }} | |
delete-ghost-images: true | |
delete-partial-images: true | |
delete-orphaned-images: true |