Skip to content

Refactor Telegram PRD refine to Codex-first dynamic questioning #20

Refactor Telegram PRD refine to Codex-first dynamic questioning

Refactor Telegram PRD refine to Codex-first dynamic questioning #20

Workflow file for this run

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
}