chore: update CI/CD workflows and configuration

- Enhanced .golangci.yml with additional linters and settings for improved code quality checks.
- Updated CI workflow to include multiple branches for pull requests and improved caching strategies.
- Added new workflows for documentation checks, dependency reviews, and security scans.
- Refined coverage analysis workflow to provide detailed reports and comments on pull requests.
- Removed outdated test workflow and consolidated testing strategies into extended tests.
- Improved release workflow with better version handling and artifact management.
This commit is contained in:
0x524a
2025-12-02 00:53:20 -05:00
parent 0551d28f61
commit 00e2e0d46f
12 changed files with 798 additions and 133 deletions
+77 -9
View File
@@ -1,34 +1,42 @@
name: Extra Tests
name: Extended Tests
on:
workflow_dispatch: # Manual trigger only
workflow_dispatch: # Manual trigger
schedule:
- cron: '0 2 * * *' # Daily at 2 AM UTC
- cron: '0 2 * * 0' # Weekly on Sunday at 2 AM UTC
push:
branches: [ master, main ]
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
jobs:
# Run tests on other Go versions as manual/scheduled job
# Run tests on older Go versions
test-older-versions:
name: Test on Go ${{ matrix.go-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
os: [ubuntu-latest]
go-version: ['1.20', '1.19']
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@a4a2eec1d0ddf3f5835416e10cb208206f91ce91 # v5.0.0
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go modules
uses: actions/cache@e5f3f4dc664b57a06a2055cfc9b80cf9f20aba75 # v4.0.1
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
@@ -38,3 +46,63 @@ jobs:
- name: Run tests
run: go test -v -race ./...
# Run benchmarks
benchmark:
name: Benchmark Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-1.23-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-1.23-
- name: Download dependencies
run: go mod download
- name: Run benchmarks
run: go test -bench=. -benchmem ./... -run=^$ || echo "⚠️ No benchmarks found"
# Test with race detector
race-detector:
name: Race Detector Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-1.23-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-1.23-
- name: Download dependencies
run: go mod download
- name: Run tests with race detector
run: go test -race -timeout=10m ./...