Skip to content

Commit a9f95db

Browse files
shaxbeeZibi Mandziejewicz
authored andcommitted
feat: e2e test
1 parent bd745ed commit a9f95db

File tree

4 files changed

+90
-31
lines changed

4 files changed

+90
-31
lines changed

.github/workflows/ci.yaml

Lines changed: 85 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,42 @@
1-
name: ci
1+
name: CI
22

33
on:
44
push:
55

66
jobs:
7+
image-build:
8+
name: Image Build
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Set up QEMU
14+
uses: docker/setup-qemu-action@v3
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
with:
18+
platforms: linux/amd64,linux/arm64
19+
- name: Login to GitHub Container Registry
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Build images
26+
uses: hiberbee/github-action-skaffold@1.27.0
27+
with:
28+
command: build
29+
file-output: images.json
30+
- name: Archive image tags
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: images
34+
path: images.json
735
verify:
836
name: Verify
937
runs-on: ubuntu-latest
1038
env:
11-
CODECOV_FILE: "build/coverage.xml"
39+
CODECOV_FILE: build/coverage.xml
1240
steps:
1341
- name: Checkout
1442
uses: actions/checkout@v4
@@ -24,39 +52,69 @@ jobs:
2452
run: make lint
2553
- name: Integration test
2654
run: make integration-test coverage
27-
- name: Code Coverage Report
28-
uses: irongut/CodeCoverageSummary@v1.3.0
55+
- name: Archive coverage report
56+
uses: actions/upload-artifact@v4
2957
with:
30-
filename: ${{ env.CODECOV_FILE }}
31-
badge: true
32-
format: markdown
33-
output: both
34-
image-build:
35-
name: Image Build
58+
name: coverage
59+
path: ${{ env.CODECOV_FILE }}
60+
e2e:
61+
name: E2E Test
62+
needs:
63+
- verify
64+
- image-build
3665
runs-on: ubuntu-latest
66+
env:
67+
CODECOV_FILE: build/coverage.e2e.xml
68+
SKAFFOLD_NAMESPACE: sandbox
69+
SKAFFOLD_RUN_ID: e2e-test
3770
steps:
3871
- name: Checkout
3972
uses: actions/checkout@v4
40-
- name: Set up QEMU
41-
uses: docker/setup-qemu-action@v3
42-
- name: Set up Docker Buildx
43-
uses: docker/setup-buildx-action@v3
73+
- name: Download image tags
74+
uses: actions/download-artifact@v4
4475
with:
45-
platforms: linux/amd64,linux/arm64
46-
- name: Login to GitHub Container Registry
47-
uses: docker/login-action@v3
76+
name: images
77+
- name: Create Kind cluster
78+
uses: helm/kind-action@v1
79+
- name: Bootstrap
80+
run: |
81+
kustomize build --enable-helm config/bootstrap | kubectl apply -f -
82+
kubectl --namespace cert-manager wait --for=condition=Available deployment/cert-manager
83+
kubectl get namespace sandbox || kubectl create namespace sandbox
84+
- name: Deploy
85+
uses: hiberbee/github-action-skaffold@1.27.0
4886
with:
49-
registry: ghcr.io
50-
username: ${{ github.actor }}
51-
password: ${{ secrets.GITHUB_TOKEN }}
52-
- name: Build images
87+
command: deploy
88+
images: images.json
89+
profile: e2e
90+
- name: Run e2e tests
5391
uses: hiberbee/github-action-skaffold@1.27.0
5492
with:
55-
skaffold-version: 2.14.1
56-
command: build
57-
file-output: images.json
58-
- name: Archive image tags
93+
command: verify
94+
images: images.json
95+
profile: e2e
96+
- name: Fetch coverage
97+
run: make fetch-coverage
98+
- name: Archive coverage report
5999
uses: actions/upload-artifact@v4
60100
with:
61-
name: images
62-
path: images.json
101+
name: coverage
102+
path: ${{ env.CODECOV_FILE }}
103+
coverage:
104+
name: Coverage Report
105+
needs:
106+
- verify
107+
- e2e
108+
runs-on: ubuntu-latest
109+
steps:
110+
- name: Download coverage reports
111+
uses: actions/download-artifact@v4
112+
with:
113+
name: coverage
114+
- name: Generate
115+
uses: irongut/CodeCoverageSummary@v1.3.0
116+
with:
117+
filename: build/coverage.xml,build/coverage.e2e.xml
118+
badge: true
119+
format: markdown
120+
output: both

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ kustomize build --enable-helm config/bootstrap | kubectl apply -f -
3232

3333
```
3434
docker build --tag ghcr.io/agoda-com/etcd .
35-
```
36-
37-
```
3835
kubectl apply -k config/default
3936
```
4037

config/default/kustomization.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ kind: Kustomization
33
namespace: etcd
44
resources:
55
- ../rbac
6-
- ../base
6+
- ../base
7+
- namespace.yaml

config/default/namespace.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Namespace
2+
metadata:
3+
name: etcd

0 commit comments

Comments
 (0)