3
3
pull_request_target :
4
4
types :
5
5
- labeled
6
+
7
+ env :
8
+ A8R_AGENT_REGISTRY : ' localhost:5000'
9
+ KUBECONFIG : ${{ github.workspace }}/kubeconfig.yaml
10
+
6
11
jobs :
7
12
build-image :
8
13
runs-on : ubuntu-latest
@@ -22,69 +27,35 @@ jobs:
22
27
uses : actions/setup-go@v3
23
28
with :
24
29
go-version : stable
25
- - name : Build image
26
- run : |
27
- make image-tar
28
- - name : Upload image
29
- uses : actions/upload-artifact@v3
30
- with :
31
- name : image
32
- path : build-output/ambassador-agent-image.tar
33
- test :
34
- runs-on : ubuntu-latest
35
- needs : build-image
36
- steps :
37
- - name : Checkout
38
- uses : actions/checkout@v3
39
- with :
40
- fetch-depth : 0
41
- ref : " ${{ github.event.pull_request.head.sha }}"
42
- - name : Get last run
43
- uses : ./.github/actions/rerun-cache
44
- id : get_last_run
45
- - name : Setup Go
46
- uses : actions/setup-go@v3
47
- with :
48
- go-version : stable
49
30
- name : Setup kubectl
50
31
uses : azure/setup-kubectl@v3
51
32
id : kubectl
52
- if : steps.get_last_run.outputs.passed != 'success'
53
- - name : Download image
54
- uses : actions/download-artifact@v3
55
- if : steps.get_last_run.outputs.passed != 'success'
56
- with :
57
- name : image
58
- - name : Prepare kluster
59
- uses : ./.github/actions/prepare-kluster
60
- if : steps.get_last_run.outputs.passed != 'success'
33
+ - name : Provision Kubeception cluster
61
34
id : kluster
62
- with :
63
- token : ${{ secrets.DEV_AMBASSADOR_AGENT_KUBECEPTION_TOKEN }}
64
- image-tar : ambassador-agent-image.tar
65
- github-sha : ${{ github.event.pull_request.head.sha }}
35
+ uses :
datawire/infra-actions/[email protected]
36
+ with :
37
+ distribution : Kubeception
38
+ version : 1.26
39
+ kubeconfig : ${{ env.KUBECONFIG }}
40
+ kubeceptionToken : ${{ secrets.DEV_AMBASSADOR_AGENT_KUBECEPTION_TOKEN }}
41
+ gkeCredentials : ' {"project_id": "foo"}'
42
+ - name : Add a private image registry to the cluster
43
+ run : make private-registry
44
+ - name : Build image
45
+ id : build
46
+ run : |
47
+ make push-image
48
+ echo "version=$(cat build-output/version.txt)" >> $GITHUB_OUTPUT
66
49
- name : Run tests
67
- if : steps.get_last_run.outputs.passed != 'success'
68
50
uses : nick-invision/retry@v2
51
+ env :
52
+ A8R_AGENT_VERSION : ${{ steps.build.outputs.version }}
53
+ AMBASSADOR_AGENT_DOCKER_IMAGE : localhost:5000/ambassador-agent:${{ steps.build.outputs.version }}
54
+ KAT_SERVER_DOCKER_IMAGE : docker.io/datawiredev/kat-server:3.0.1-0.20220817135951-2cb28ef4f415
69
55
with :
70
56
max_attempts : 3
71
57
timeout_minutes : 15
72
58
command : |
73
- export DTEST_KUBECONFIG=${{ steps.kluster.outputs.kubeconfig }}
74
- export KUBECONFIG=${{ steps.kluster.outputs.kubeconfig }}
75
- export AMBASSADOR_AGENT_DOCKER_IMAGE=datawiredev/ambassador-agent:dev-latest
76
- export KAT_SERVER_DOCKER_IMAGE=docker.io/datawiredev/kat-server:3.0.1-0.20220817135951-2cb28ef4f415
77
59
make go-integration-test
78
60
- name : Mark test as succesfull
79
61
run : echo "::set-output name=run_result::success" > run_result
80
- - name : Cleanup kluster
81
- uses : ./.github/actions/cleanup-kluster
82
- if : always()
83
- with :
84
- token : ${{ secrets.DEV_AMBASSADOR_AGENT_KUBECEPTION_TOKEN }}
85
- github-sha : ${{ github.event.pull_request.head.sha }}
86
-
87
-
88
-
89
-
90
-
0 commit comments