Enhance Release Workflow: Automated Changelog Management and Validation #213
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Go CI | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-version: [ '1.21', '1.22', '1.23'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: 'true' | |
| - name: Verify dependencies | |
| run: | | |
| go mod verify | |
| go mod tidy | |
| git diff --exit-code go.mod go.sum || (echo "go.mod or go.sum changed unexpectedly" && exit 1) | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v6 | |
| with: | |
| version: latest | |
| - name: Run tests | |
| env: | |
| JIRA_API_KEY: ${{ secrets.JIRA_API_KEY }} | |
| JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | |
| JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }} | |
| run: | | |
| go test -v -race -timeout 10m ./... | |
| - name: Run coverage | |
| env: | |
| JIRA_API_KEY: ${{ secrets.JIRA_API_KEY }} | |
| JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | |
| JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }} | |
| run: | | |
| go test -race -coverprofile=coverage.txt -covermode=atomic -timeout 10m ./... | |
| go tool cover -func=coverage.txt | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_ORG_TOKEN }} | |
| fail_ci_if_error: true |