-
Notifications
You must be signed in to change notification settings - Fork 39
109 lines (91 loc) · 2.98 KB
/
e2e-test.yml
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
name: E2E Test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
docker:
name: Docker E2E Tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: e2e-buildx
uses: docker/setup-buildx-action@v2
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v2
- name: Set up QEMU
id: e2e-qemu
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Build Images
run: |
retail-store-sample-app/scripts/build-image.sh -t e2e
- name: Run Tests
run: |
(cd retail-store-sample-app/deploy/docker-compose && TAG=e2e MYSQL_PASSWORD='test123' docker-compose up -d)
(bash retail-store-sample-app/scripts/e2e-compose.sh)
(cd retail-store-sample-app/deploy/docker-compose && docker-compose down)
kubernetes:
name: Kubernetes E2E Tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: e2e-buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
id: e2e-qemu
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Build Images
run: |
retail-store-sample-app/scripts/build-image.sh -r 'public.ecr.aws/aws-containers' -t e2e
- name: Setup helmfile
uses: mamezou-tech/[email protected]
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
cluster_name: kind
version: v0.17.0
- name: Deploy
env:
IMAGE_TAG: e2e
run: |
kind load docker-image public.ecr.aws/aws-containers/retail-store-sample-assets:$IMAGE_TAG
kind load docker-image public.ecr.aws/aws-containers/retail-store-sample-catalog:$IMAGE_TAG
kind load docker-image public.ecr.aws/aws-containers/retail-store-sample-cart:$IMAGE_TAG
kind load docker-image public.ecr.aws/aws-containers/retail-store-sample-checkout:$IMAGE_TAG
kind load docker-image public.ecr.aws/aws-containers/retail-store-sample-orders:$IMAGE_TAG
kind load docker-image public.ecr.aws/aws-containers/retail-store-sample-ui:$IMAGE_TAG
(cd retail-store-sample-app/deploy/kubernetes/charts && helmfile apply --wait)
sleep 60
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: ui-nodeport
spec:
type: NodePort
selector:
app.kubernetes.io/name: ui
app.kubernetes.io/instance: ui
app.kubernetes.io/component: service
ports:
- port: 80
targetPort: http
nodePort: 30000
EOF
- name: Test
run: |
bash retail-store-sample-app/scripts/e2e-kind.sh