Skip to content

Commit f21fb8c

Browse files
committed
Feat: enhance ci
Signed-off-by: Charlie Chiang <[email protected]>
1 parent 0a219b6 commit f21fb8c

File tree

8 files changed

+30
-29
lines changed

8 files changed

+30
-29
lines changed

.github/workflows/docs-check.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515

1616
jobs:
1717
checks:
18+
name: Check Docs
1819
runs-on: ubuntu-latest
1920
steps:
2021
- name: Install xmllint

.github/workflows/go-checks.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818

1919
jobs:
2020
detect-noop:
21+
name: Detect No-op Changes
2122
runs-on: ubuntu-latest
2223
outputs:
2324
noop: ${{ steps.noop.outputs.should_skip }}
@@ -32,6 +33,7 @@ jobs:
3233
concurrent_skipping: false
3334

3435
checks:
36+
name: Check Go Code
3537
runs-on: ubuntu-latest
3638
needs: detect-noop
3739
if: needs.detect-noop.outputs.noop != 'true'

.github/workflows/release-binary.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414

1515
jobs:
1616
kube-trigger:
17-
name: Release kube-trigger binaries
17+
name: Release kube-trigger Binaries
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout Code
@@ -41,7 +41,7 @@ jobs:
4141
- name: Get Version
4242
id: get_version
4343
run: |
44-
export VERSION=$(./make-kt version)
44+
VERSION=$(./make-kt version)
4545
echo ::set-output name=VERSION::${VERSION}
4646
4747
- name: Build Binaries for All Platforms

.github/workflows/release-image.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
kube-trigger:
13-
name: Release kube-trigger image
13+
name: Release kube-trigger Images
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout Code
@@ -49,7 +49,7 @@ jobs:
4949
run: ./make-kt all-docker-build-push
5050

5151
manager:
52-
name: Release manager image
52+
name: Release manager Images
5353
runs-on: ubuntu-latest
5454
steps:
5555
- name: Checkout Code

.github/workflows/unit-test.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ env:
1919

2020
jobs:
2121
detect-noop:
22+
name: Detect No-op Changes
2223
runs-on: ubuntu-latest
2324
outputs:
2425
noop: ${{ steps.noop.outputs.should_skip }}
@@ -33,6 +34,7 @@ jobs:
3334
concurrent_skipping: false
3435

3536
unit-test:
37+
name: Run Unit Tests and Integration Tests
3638
runs-on: ubuntu-latest
3739
needs: detect-noop
3840
if: needs.detect-noop.outputs.noop != 'true'

.github/workflows/upload-test-binary.yaml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ env:
1919

2020
jobs:
2121
detect-noop:
22+
name: Detect No-op Changes
2223
runs-on: ubuntu-latest
2324
outputs:
2425
noop: ${{ steps.noop.outputs.should_skip }}
@@ -33,9 +34,19 @@ jobs:
3334
concurrent_skipping: false
3435

3536
upload-test-binary:
37+
name: Build and Upload Test Binaries
3638
needs: detect-noop
3739
if: needs.detect-noop.outputs.noop != 'true'
3840
runs-on: ubuntu-latest
41+
strategy:
42+
matrix:
43+
platform:
44+
- linux-amd64
45+
- darwin-amd64
46+
- darwin-arm64
47+
binary:
48+
- kube-trigger
49+
- manager
3950
steps:
4051
- name: Checkout Code
4152
uses: actions/checkout@v3
@@ -64,31 +75,19 @@ jobs:
6475
- name: Get Version
6576
id: get_version
6677
run: |
67-
export VERSION=$(./make-kt version)
78+
VERSION=$(./make-kt version)
6879
echo ::set-output name=VERSION::${VERSION}
6980
70-
- name: Build Binaries for linux and darwin
81+
- name: Build Binary
7182
env:
7283
DIRTY_BUILD: true
7384
run: |
74-
./make-kt build-linux_amd64
75-
./make-kt build-darwin_amd64
76-
./make-kt build-darwin_arm64
85+
PLATFORM=${{ matrix.platform }}
86+
BINARY=${{ matrix.binary }}
87+
make -f ${BINARY/-/}.mk build-${PLATFORM/-/_}
7788
78-
- name: Upload Artifacts (linux-amd64)
89+
- name: Upload Artifacts
7990
uses: actions/upload-artifact@v3
8091
with:
81-
name: kube-trigger-${{ steps.get_version.outputs.VERSION }}-linux-amd64
82-
path: bin/kube-trigger-${{ steps.get_version.outputs.VERSION }}/kube-trigger-*-linux-amd64
83-
84-
- name: Upload Artifacts (darwin-amd64)
85-
uses: actions/upload-artifact@v3
86-
with:
87-
name: kube-trigger-${{ steps.get_version.outputs.VERSION }}-darwin-amd64
88-
path: bin/kube-trigger-${{ steps.get_version.outputs.VERSION }}/kube-trigger-*-darwin-amd64
89-
90-
- name: Upload Artifacts (darwin-arm64)
91-
uses: actions/upload-artifact@v3
92-
with:
93-
name: kube-trigger-${{ steps.get_version.outputs.VERSION }}-darwin-arm64
94-
path: bin/kube-trigger-${{ steps.get_version.outputs.VERSION }}/kube-trigger-*-darwin-arm64
92+
name: ${{ matrix.binary }}-${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}
93+
path: bin/${{ matrix.binary }}-${{ steps.get_version.outputs.VERSION }}/${{ matrix.binary }}-*-${{ matrix.platform }}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
cloud.google.com/go v0.102.0
77
cuelang.org/go v0.4.3
88
github.com/imdario/mergo v0.3.12
9+
github.com/mitchellh/mapstructure v1.5.0
910
github.com/oam-dev/kubevela-core-api v1.6.0-alpha.1
1011
github.com/onsi/ginkgo/v2 v2.1.4
1112
github.com/onsi/gomega v1.20.0
@@ -20,6 +21,7 @@ require (
2021
k8s.io/apimachinery v0.24.3
2122
k8s.io/client-go v0.24.3
2223
sigs.k8s.io/controller-runtime v0.12.3
24+
sigs.k8s.io/yaml v1.3.0
2325
)
2426

2527
require (
@@ -65,7 +67,6 @@ require (
6567
github.com/json-iterator/go v1.1.12 // indirect
6668
github.com/mailru/easyjson v0.7.6 // indirect
6769
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
68-
github.com/mitchellh/mapstructure v1.5.0 // indirect
6970
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
7071
github.com/modern-go/reflect2 v1.0.2 // indirect
7172
github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de // indirect
@@ -123,7 +124,6 @@ require (
123124
sigs.k8s.io/apiserver-runtime v1.1.1 // indirect
124125
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
125126
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
126-
sigs.k8s.io/yaml v1.3.0 // indirect
127127
)
128128

129129
replace sigs.k8s.io/apiserver-network-proxy/konnectivity-client => sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.24

go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,6 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG
558558
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
559559
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
560560
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
561-
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
562561
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
563562
github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4=
564563
github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ=
@@ -709,7 +708,6 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe
709708
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
710709
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
711710
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
712-
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
713711
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
714712
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
715713
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
@@ -1925,7 +1923,6 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
19251923
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
19261924
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM=
19271925
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
1928-
golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
19291926
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
19301927
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
19311928
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 commit comments

Comments
 (0)