Refactor Telegram PRD refine to Codex-first dynamic questioning #20
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: Test | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| go-test: | |
| runs-on: ubuntu-latest | |
| env: | |
| COVERAGE_MIN: "25.0" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: false | |
| - id: coverage | |
| name: Run go test with coverage | |
| run: | | |
| set -euo pipefail | |
| go test ./... -covermode=atomic -coverprofile=coverage.out | |
| go tool cover -func=coverage.out | tee coverage.txt | |
| total="$(awk '/^total:/ {print $3}' coverage.txt)" | |
| echo "total=${total}" >> "${GITHUB_OUTPUT}" | |
| - name: Upload coverage artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-${{ github.sha }} | |
| path: | | |
| coverage.out | |
| coverage.txt | |
| if-no-files-found: error | |
| - name: Publish test summary | |
| run: | | |
| echo "Total Go coverage: ${{ steps.coverage.outputs.total }}" >> "${GITHUB_STEP_SUMMARY}" | |
| - name: Enforce minimum coverage | |
| run: | | |
| set -euo pipefail | |
| total="${{ steps.coverage.outputs.total }}" | |
| pct="${total%\%}" | |
| min="${COVERAGE_MIN}" | |
| awk -v pct="${pct}" -v min="${min}" 'BEGIN { exit !(pct+0 >= min+0) }' || { | |
| echo "coverage gate failed: total=${total}, required>=${min}%" | |
| exit 1 | |
| } |