@@ -33,87 +33,42 @@ concurrency:
3333jobs :
3434 check-license :
3535 name : License header
36- if : ( github.event_name == 'schedule' && github. repository == 'apache/skywalking-cli') || (github.event_name != 'schedule')
36+ if : github.repository == 'apache/skywalking-cli'
3737 runs-on : ubuntu-latest
3838 steps :
39- - uses : actions/checkout@v3
39+ - uses : actions/checkout@v4
4040
4141 - name : Check License Header
4242 uses : apache/skywalking-eyes@5dfa68f93380a5e57259faaf95088b7f133b5778
4343 env :
4444 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4545
4646 - name : Setup Go
47- uses : actions/setup-go@v4
47+ uses : actions/setup-go@v5
4848 with :
49- go-version : " 1.18 "
49+ go-version : " 1.24 "
5050
5151 - name : Check Dependencies License
5252 run : make dependency-license
5353
54-
55- changes :
56- runs-on : ubuntu-latest
57- if : github.event_name != 'schedule'
58- timeout-minutes : 10
59- outputs :
60- cli : ${{ steps.filter-cli.outputs.any_modified }}
61- steps :
62- - uses : actions/checkout@v3 # required for push event
63- with :
64- fetch-depth : 0
65- - name : Check for CLI source changes
66- id : filter-cli
67- # The GHA version is pinned by infra
68- uses : tj-actions/changed-files@v43.0.0
69- with :
70- files_from_source_file : .github/file-filters.txt
71- - name : List all modified files
72- if : steps.filter-cli.outputs.any_modified == 'true'
73- run : |
74- echo "Files that have changed or modified:"
75- echo "Filter-cli: ${{ steps.filter-cli.outputs.all_changed_and_modified_files }}"
76-
77-
78- golang-lint :
79- name : Golang Lint
80- runs-on : ubuntu-latest
81- needs : [changes]
82- if : |
83- ( always() && ! cancelled() ) &&
84- ((github.event_name == 'schedule' && github.repository == 'apache/skywalking-cli') || needs.changes.outputs.cli == 'true')
85- steps :
86- - uses : actions/checkout@v3
87- - name : Set up Go
88- uses : actions/setup-go@v4
89- with :
90- go-version : 1.18
91-
92- - name : golangci-lint
93- uses : golangci/golangci-lint-action@v6
94- with :
95- version : v1.50.0
96- args : --timeout 5m
97-
98-
9954 build :
10055 name : Build
101- needs : [changes]
10256 runs-on : ubuntu-latest
103- if : |
104- ( always() && ! cancelled() ) &&
105- ((github.event_name == 'schedule' && github.repository == 'apache/skywalking-cli') || needs.changes.outputs.cli == 'true')
57+ if : github.repository == 'apache/skywalking-cli'
10658 steps :
107- - uses : actions/checkout@v3
59+ - uses : actions/checkout@v4
10860 - name : Set up Go
109- uses : actions/setup-go@v4
61+ uses : actions/setup-go@v5
11062 with :
111- go-version : 1.18
63+ go-version : 1.24
11264
11365 - name : Check code generation
11466 run : make check-codegen
11567
116- - uses : actions/upload-artifact@v3
68+ - name : Lint
69+ run : make lint
70+
71+ - uses : actions/upload-artifact@v4
11772 if : failure()
11873 with :
11974 name : check-diff
@@ -129,20 +84,20 @@ jobs:
12984 command-tests :
13085 name : Command Tests
13186 runs-on : ubuntu-latest
132- needs : [changes]
133- if : |
134- ( always() && ! cancelled() ) &&
135- ((github.event_name == 'schedule' && github.repository == 'apache/skywalking-cli') || needs.changes.outputs.cli == 'true')
87+ if : github.repository == 'apache/skywalking-cli'
13688 strategy :
13789 matrix :
13890 oap :
13991 - a65a6e0ff2ef9c716131b36172399076307c35f1 # Feb 27th, 2024
14092 steps :
141- - uses : actions/checkout@v3
93+ - uses : actions/checkout@v4
14294 - name : Set up Go
143- uses : actions/setup-go@v4
95+ uses : actions/setup-go@v5
14496 with :
145- go-version : 1.18
97+ go-version : 1.24
98+
99+ - name : Install swctl
100+ run : make install DESTDIR=/usr/local/bin
146101
147102 - name : Test commands
148103 uses : apache/skywalking-infra-e2e@cf589b4a0b9f8e6f436f78e9cfd94a1ee5494180
@@ -155,16 +110,13 @@ jobs:
155110 unit-tests :
156111 name : Unit Tests
157112 runs-on : ubuntu-latest
158- needs : [changes]
159- if : |
160- ( always() && ! cancelled() ) &&
161- ((github.event_name == 'schedule' && github.repository == 'apache/skywalking-cli') || needs.changes.outputs.cli == 'true')
113+ if : github.repository == 'apache/skywalking-cli'
162114 steps :
163- - uses : actions/checkout@v3
115+ - uses : actions/checkout@v4
164116 - name : setup go
165- uses : actions/setup-go@v4
117+ uses : actions/setup-go@v5
166118 with :
167- go-version : ' 1.18 '
119+ go-version : ' 1.24 '
168120
169121 - name : run unit tests and report coverage
170122 working-directory : ./
@@ -176,7 +128,6 @@ jobs:
176128 name : Required
177129 needs :
178130 - check-license
179- - golang-lint
180131 - build
181132 - command-tests
182133 - unit-tests
@@ -185,15 +136,12 @@ jobs:
185136 steps :
186137 - name : Merge Requirement
187138 run : |
188- execute=${{ needs.changes.outputs.cli }}
189139 checkLicense=${{ needs.check-license.result }}
190- [[ ${checkLicense} == 'success' ]] || exit -1;
191- golangLint=${{ needs.golang-lint.result }};
140+ [[ ${checkLicense} == 'success' ]] || exit 1;
192141 build=${{ needs.build.result }};
193142 commandTests=${{ needs.command-tests.result }};
194143 unitTests=${{ needs.unit-tests.result }};
195- [[ ${golangLint} == 'success' ]] || [[ ${execute} != 'true' && ${golangLint} == 'skipped' ]] || exit -2;
196- [[ ${build} == 'success' ]] || [[ ${execute} != 'true' && ${build} == 'skipped' ]] || exit -3;
197- [[ ${commandTests} == 'success' ]] || [[ ${execute} != 'true' && ${commandTests} == 'skipped' ]] || exit -4;
198- [[ ${unitTests} == 'success' ]] || [[ ${execute} != 'true' && ${unitTests} == 'skipped' ]] || exit -5;
199- exit 0;
144+ [[ ${build} == 'success' ]] || [[ ${build} == 'skipped' ]] || exit 3;
145+ [[ ${commandTests} == 'success' ]] || [[ ${commandTests} == 'skipped' ]] || exit 4;
146+ [[ ${unitTests} == 'success' ]] || [[ ${unitTests} == 'skipped' ]] || exit 5;
147+ exit 0;
0 commit comments