Skip to content

Commit 857b5b5

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

File tree

4 files changed

+96
-31
lines changed

4 files changed

+96
-31
lines changed

.github/workflows/ci.yaml

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

33
on:
44
push:
55

6+
env:
7+
SKAFFOLD_VERSION: 2.14.1
8+
69
jobs:
10+
image-build:
11+
name: Image Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
with:
21+
platforms: linux/amd64,linux/arm64
22+
- name: Login to GitHub Container Registry
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Build images
29+
uses: hiberbee/github-action-skaffold@1.27.0
30+
with:
31+
skaffold-version: ${{ env.SKAFFOLD_VERSION }}
32+
command: build
33+
file-output: images.json
34+
- name: Archive image tags
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: images
38+
path: images.json
739
verify:
840
name: Verify
941
runs-on: ubuntu-latest
1042
env:
11-
CODECOV_FILE: "build/coverage.xml"
43+
CODECOV_FILE: build/coverage.xml
1244
steps:
1345
- name: Checkout
1446
uses: actions/checkout@v4
@@ -24,39 +56,71 @@ jobs:
2456
run: make lint
2557
- name: Integration test
2658
run: make integration-test coverage
27-
- name: Code Coverage Report
28-
uses: irongut/CodeCoverageSummary@v1.3.0
59+
- name: Archive coverage report
60+
uses: actions/upload-artifact@v4
2961
with:
30-
filename: ${{ env.CODECOV_FILE }}
31-
badge: true
32-
format: markdown
33-
output: both
34-
image-build:
35-
name: Image Build
62+
name: coverage
63+
path: ${{ env.CODECOV_FILE }}
64+
e2e:
65+
name: E2E Test
66+
needs:
67+
- verify
68+
- image-build
3669
runs-on: ubuntu-latest
70+
env:
71+
CODECOV_FILE: build/coverage.e2e.xml
72+
SKAFFOLD_NAMESPACE: sandbox
73+
SKAFFOLD_RUN_ID: e2e-test
3774
steps:
3875
- name: Checkout
3976
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
77+
- name: Download image tags
78+
uses: actions/download-artifact@v4
4479
with:
45-
platforms: linux/amd64,linux/arm64
46-
- name: Login to GitHub Container Registry
47-
uses: docker/login-action@v3
80+
name: images
81+
- name: Create Kind cluster
82+
uses: helm/kind-action@v1
83+
- name: Bootstrap
84+
run: |
85+
kustomize build --enable-helm config/bootstrap | kubectl apply -f -
86+
kubectl --namespace cert-manager wait --for=condition=Available deployment/cert-manager
87+
kubectl get namespace sandbox || kubectl create namespace sandbox
88+
- name: Deploy
89+
uses: hiberbee/github-action-skaffold@1.27.0
4890
with:
49-
registry: ghcr.io
50-
username: ${{ github.actor }}
51-
password: ${{ secrets.GITHUB_TOKEN }}
52-
- name: Build images
91+
skaffold-version: ${{ env.SKAFFOLD_VERSION }}
92+
command: deploy
93+
images: images.json
94+
profile: e2e
95+
- name: Run e2e tests
5396
uses: hiberbee/github-action-skaffold@1.27.0
5497
with:
55-
skaffold-version: 2.14.1
56-
command: build
57-
file-output: images.json
58-
- name: Archive image tags
98+
skaffold-version: ${{ env.SKAFFOLD_VERSION }}
99+
command: verify
100+
images: images.json
101+
profile: e2e
102+
- name: Fetch coverage
103+
run: make fetch-coverage
104+
- name: Archive coverage report
59105
uses: actions/upload-artifact@v4
60106
with:
61-
name: images
62-
path: images.json
107+
name: coverage
108+
path: ${{ env.CODECOV_FILE }}
109+
coverage:
110+
name: Coverage Report
111+
needs:
112+
- verify
113+
- e2e
114+
runs-on: ubuntu-latest
115+
steps:
116+
- name: Download coverage reports
117+
uses: actions/download-artifact@v4
118+
with:
119+
name: coverage
120+
- name: Generate
121+
uses: irongut/CodeCoverageSummary@v1.3.0
122+
with:
123+
filename: build/coverage.xml,build/coverage.e2e.xml
124+
badge: true
125+
format: markdown
126+
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)