-
-
Notifications
You must be signed in to change notification settings - Fork 517
145 lines (142 loc) · 5.1 KB
/
dev.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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_SENVER=${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 cluster images
run: |
make build-images-x
- 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--push ${{env.TELEPRESENCE_REGISTRY}}/telepresence:${{env.TELEPRESENCE_SEMVER}} .
- name: Push tel2 image
run: docker--push ${{env.TELEPRESENCE_REGISTRY}}/tel2:${{env.TELEPRESENCE_SEMVER}} .
- 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
- macos-13 # use macos-latest once that runner (which is arm64) supports virtualization.
# Re-enable when virtualization is available so that WSL2 can be used and docker has a linux container daemon.
# - 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: Start colima
if: runner.os == 'macOS'
shell: bash
run: |
brew install kubectl docker colima
# the macos-13 runner has 4 cpus, 14 GiB memory, and 14 GiB disk
colima start --kubernetes --cpu 2 --memory 6 --disk 10
- name: Install Argo Rollouts
shell: bash
run: |
kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml
- 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:
runs-on: ubuntu-latest
if: always()
needs:
- build_images
- run_tests
steps:
- name: Delete tel2 image
uses: bots-house/[email protected]
continue-on-error: true
with:
owner: telepresenceio
name: tel2
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.build_images.outputs.telepresenceSemver }}
- name: Delete telepresence image
uses: bots-house/[email protected]
continue-on-error: true
with:
owner: telepresenceio
name: telepresence
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.build_images.outputs.telepresenceSemver }}
- name: Delete tel2 untagged images
uses: bots-house/[email protected]
with:
owner: telepresenceio
name: tel2
token: ${{ secrets.GITHUB_TOKEN }}
untagged-keep-latest: 6
- name: Delete telepresence untagged images
uses: bots-house/[email protected]
with:
owner: telepresenceio
name: telepresence
token: ${{ secrets.GITHUB_TOKEN }}
untagged-keep-latest: 6