Update ci.yml

cognitive committed Oct 23, 2025 at 01:22 UTC f60948d26ed4308e1144abc325e4dd12a1f0585d
1 file changed +54 -53
.github/workflows/ci.yml
+54 -53
@@ -2,9 +2,9 @@ name: CI
2
3 on:
4 push:
5 - branches: [main, develop]
5 + branches: [main]
6 pull_request:
7 - branches: [main, develop]
7 + branches: [main, develop, dev]
8 workflow_dispatch:
9
10 permissions:
@@ -72,7 +72,7 @@ jobs:
72 runs-on: ubuntu-latest
73 strategy:
74 matrix:
75 - go-version: ['1.25.0', '1.24.x']
75 + go-version: ['1.25.0']
76 steps:
77 - name: Checkout code
78 uses: actions/checkout@v4
@@ -103,49 +103,49 @@ jobs:
103 path: bin/*
104 retention-days: 7
105
106 - # Test job - unit tests with race detection
107 - test:
108 - name: Test
109 - runs-on: ubuntu-latest
110 - strategy:
111 - matrix:
112 - go-version: ['1.25.0', '1.24.x']
113 - steps:
114 - - name: Checkout code
115 - uses: actions/checkout@v4
116 -
117 - - name: Set up Go ${{ matrix.go-version }}
118 - uses: actions/setup-go@v5
119 - with:
120 - go-version: ${{ matrix.go-version }}
121 - cache: true
122 -
123 - - name: Download dependencies
124 - run: go mod download
125 -
126 - - name: Run tests
127 - run: go test -v -race -timeout=5m -coverprofile=coverage.out -covermode=atomic ./...
128 -
129 - - name: Generate coverage report
130 - if: matrix.go-version == '1.25.0'
131 - run: go tool cover -html=coverage.out -o coverage.html
132 -
133 - - name: Upload coverage report
134 - uses: actions/upload-artifact@v4
135 - if: matrix.go-version == '1.25.0'
136 - with:
137 - name: coverage-report
138 - path: coverage.html
139 - retention-days: 7
140 -
141 - - name: Check test coverage
142 - if: matrix.go-version == '1.25.0'
143 - run: |
144 - coverage=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}')
145 - echo "Total test coverage: ${coverage}%"
146 - if (( $(echo "$coverage < 30" | bc -l) )); then
147 - echo "Warning: Test coverage is below 30%"
148 - fi
106 + # # Test job - unit tests with race detection
107 + # test:
108 + # name: Test
109 + # runs-on: ubuntu-latest
110 + # strategy:
111 + # matrix:
112 + # go-version: ['1.25.0', '1.24.x']
113 + # steps:
114 + # - name: Checkout code
115 + # uses: actions/checkout@v4
116 +
117 + # - name: Set up Go ${{ matrix.go-version }}
118 + # uses: actions/setup-go@v5
119 + # with:
120 + # go-version: ${{ matrix.go-version }}
121 + # cache: true
122 +
123 + # - name: Download dependencies
124 + # run: go mod download
125 +
126 + # - name: Run tests
127 + # run: go test -v -race -timeout=5m -coverprofile=coverage.out -covermode=atomic ./...
128 +
129 + # - name: Generate coverage report
130 + # if: matrix.go-version == '1.25.0'
131 + # run: go tool cover -html=coverage.out -o coverage.html
132 +
133 + # - name: Upload coverage report
134 + # uses: actions/upload-artifact@v4
135 + # if: matrix.go-version == '1.25.0'
136 + # with:
137 + # name: coverage-report
138 + # path: coverage.html
139 + # retention-days: 7
140 +
141 + # - name: Check test coverage
142 + # if: matrix.go-version == '1.25.0'
143 + # run: |
144 + # coverage=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}')
145 + # echo "Total test coverage: ${coverage}%"
146 + # if (( $(echo "$coverage < 30" | bc -l) )); then
147 + # echo "Warning: Test coverage is below 30%"
148 + # fi
149
150 # Sanitizers job - static analysis and security checks
151 sanitizers:
@@ -175,13 +175,6 @@ jobs:
175 gosec -fmt=json -out=gosec-report.json ./... || true
176 gosec ./...
177
178 - - name: Upload gosec report
179 - uses: actions/upload-artifact@v4
180 - with:
181 - name: gosec-report
182 - path: gosec-report.json
183 - retention-days: 7
184 -
178 - name: Check for ineffective assignments
179 run: |
180 go install github.com/gordonklaus/ineffassign@latest
@@ -192,6 +185,14 @@ jobs:
185 go install honnef.co/go/tools/cmd/staticcheck@latest
186 staticcheck -checks=U1000 ./...
187
188 +
189 + - name: Upload gosec report
190 + uses: actions/upload-artifact@v4
191 + with:
192 + name: gosec-report
193 + path: gosec-report.json
194 + retention-days: 7
195 +
196 # Docker build job
197 docker:
198 name: Docker Build