@@ -2,50 +2,17 @@ name: CI Pipeline
22
33on :
44 push :
5- branches : [ main, develop ]
5+ branches : [ main ]
66 pull_request :
7- branches : [ main, develop ]
7+ branches : [ main ]
88
99env :
1010 GO_VERSION : ' 1.23.x'
1111
1212jobs :
13- # Lint and Format Check
14- lint :
15- name : Lint and Format
16- runs-on : ubuntu-latest
17- steps :
18- - name : Checkout code
19- uses : actions/checkout@v4
20-
21- - name : Set up Go
22- uses : actions/setup-go@v5
23- with :
24- go-version : ${{ env.GO_VERSION }}
25- - name : Run golangci-lint
26- uses : golangci/golangci-lint-action@v8
27- with :
28- version : v2.3.1
29-
30- # Schema and Example Validation
31- validate :
32- name : Validate Schemas and Examples
33- runs-on : ubuntu-latest
34- steps :
35- - name : Checkout code
36- uses : actions/checkout@v4
37-
38- - name : Set up Go
39- uses : actions/setup-go@v5
40- with :
41- go-version : ${{ env.GO_VERSION }}
42-
43- - name : Validate schemas and examples
44- run : make validate
45-
46- # Build check
47- build :
48- name : Build Check
13+ # Build, Lint, and Validate
14+ build-lint-validate :
15+ name : Build, Lint, and Validate
4916 runs-on : ubuntu-latest
5017 steps :
5118 - name : Checkout code
6936 - name : Download dependencies
7037 run : go mod download
7138
39+ - name : Install golangci-lint
40+ run : |
41+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.3.1
42+
43+ - name : Run lint
44+ run : make lint
45+
46+ - name : Validate schemas and examples
47+ run : make validate
48+
7249 - name : Build application
7350 run : make build
7451
@@ -77,11 +54,11 @@ jobs:
7754 go install golang.org/x/vuln/cmd/govulncheck@latest
7855 govulncheck ./...
7956
80- # Unit Tests
81- unit- tests :
82- name : Unit Tests
57+ # All Tests
58+ tests :
59+ name : Tests
8360 runs-on : ubuntu-latest
84- needs : [ lint, validate, build]
61+ needs : build- lint- validate
8562 steps :
8663 - name : Checkout code
8764 uses : actions/checkout@v4
10481 - name : Download dependencies
10582 run : go mod download
10683
107- - name : Run unit tests
108- run : make test
84+ - name : Run all tests
85+ run : make test-all
10986
11087 - name : Upload coverage to Codecov
11188 uses : codecov/codecov-action@v4
@@ -114,52 +91,3 @@ jobs:
11491 flags : unittests
11592 name : codecov-unit
11693 fail_ci_if_error : false
117-
118- # Integration Tests
119- integration-tests :
120- name : Integration Tests
121- runs-on : ubuntu-latest
122- needs : [lint, validate, build]
123- steps :
124- - name : Checkout code
125- uses : actions/checkout@v4
126-
127- - name : Set up Go
128- uses : actions/setup-go@v5
129- with :
130- go-version : ${{ env.GO_VERSION }}
131-
132- - name : Cache Go modules
133- uses : actions/cache@v4
134- with :
135- path : |
136- ~/.cache/go-build
137- ~/go/pkg/mod
138- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
139- restore-keys : |
140- ${{ runner.os }}-go-
141-
142- - name : Download dependencies
143- run : go mod download
144-
145- - name : Run integration tests
146- run : make integration-test
147-
148- # Overall status check
149- test-summary :
150- name : Test Summary
151- runs-on : ubuntu-latest
152- needs : [unit-tests, integration-tests]
153- if : always()
154- steps :
155- - name : Check test results
156- run : |
157- if [[ "${{ needs.unit-tests.result }}" == "success" && "${{ needs.integration-tests.result }}" == "success" ]]; then
158- echo "✅ All tests passed!"
159- exit 0
160- else
161- echo "❌ Some tests failed:"
162- echo " Unit tests: ${{ needs.unit-tests.result }}"
163- echo " Integration tests: ${{ needs.integration-tests.result }}"
164- exit 1
165- fi
0 commit comments