Skip to content

Commit aa097c8

Browse files
authored
refactor(ci): Simplify CI workflow by removing unit-test job (#632)
* refactor(ci): Simplify CI workflow by removing unit-test job Signed-off-by: yxxhero <aiopsclub@163.com> * fix yaml issue Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> --------- Signed-off-by: yxxhero <aiopsclub@163.com>
1 parent 7b75625 commit aa097c8

File tree

3 files changed

+55
-26
lines changed

3 files changed

+55
-26
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Go
1+
name: CI
22

33
on:
44
push:
@@ -7,7 +7,6 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
1110
build-test:
1211
runs-on: ubuntu-latest
1312
steps:
@@ -18,27 +17,4 @@ jobs:
1817
go-version-file: 'go.mod'
1918
cache: true
2019
- name: build
21-
run: make build
22-
23-
unit-test:
24-
runs-on: ubuntu-latest
25-
env:
26-
SKIP_TESTS: true
27-
steps:
28-
- name: Create k8s Kind Cluster
29-
uses: helm/kind-action@v1.12.0
30-
with:
31-
cluster_name: cluster
32-
- name: Set k8s provider
33-
run: |
34-
kubectl create namespace test-namespace
35-
kubectl create secret generic mysecret -n test-namespace --from-literal=key=p4ssw0rd
36-
kubectl create configmap myconfigmap -n test-namespace --from-literal=key=configValue
37-
- uses: actions/checkout@v4
38-
- name: Set up Go
39-
uses: actions/setup-go@v5
40-
with:
41-
go-version-file: 'go.mod'
42-
cache: true
43-
- name: test
44-
run: make test
20+
run: make build

.github/workflows/e2e-test.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: E2E test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
e2e-test:
11+
runs-on: ubuntu-latest
12+
env:
13+
SKIP_TESTS: true
14+
steps:
15+
- name: Create k8s Kind Cluster
16+
uses: helm/kind-action@v1.12.0
17+
with:
18+
cluster_name: cluster
19+
- name: Set k8s provider
20+
run: |
21+
kubectl create namespace test-namespace
22+
kubectl create secret generic mysecret -n test-namespace --from-literal=key=p4ssw0rd
23+
kubectl create configmap myconfigmap -n test-namespace --from-literal=key=configValue
24+
- uses: actions/checkout@v4
25+
- name: Set up Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version-file: 'go.mod'
29+
cache: true
30+
- name: test
31+
run: make test

.github/workflows/unit-test.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Unit Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
unit-test:
11+
runs-on: ubuntu-latest
12+
env:
13+
SKIP_TESTS: true
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version-file: 'go.mod'
20+
cache: true
21+
- name: test
22+
run: echo "unit test"

0 commit comments

Comments
 (0)