Add CI test stage with coverage reporting and test infrastructure
Some checks failed
CI / build (1.21.x) (push) Has been cancelled
CI / build (1.22.x) (push) Has been cancelled
CI / security-scan (push) Has been cancelled

- Updated .github/workflows/ci.yml to include:
  - Go module caching for faster builds
  - Coverage report generation and upload to Codecov
  - 80% coverage threshold check
- Created tests/ directory with integration test framework
- Added test fixtures and configuration
- Initial integration test passes

Related: FRE-8b42289c (Pop: Add CI test stage to workflow)
This commit is contained in:
2026-05-03 20:38:29 -04:00
parent ced8204ef8
commit a78c564e23
4 changed files with 125 additions and 2 deletions

View File

@@ -21,14 +21,45 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go modules
uses: actions/cache@v4
with:
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 }}-
- name: Download dependencies
run: go mod download
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -race ./...
- name: Test with coverage
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Calculate coverage
run: |
TOTAL=$(go test -cover ./... 2>&1 | grep -oP '\d+\.\d+%$' | head -1 | tr -d '%')
echo "Coverage: ${TOTAL}"
if [ -z "$TOTAL" ]; then
echo "No coverage data found"
exit 1
fi
if (( $(echo "$TOTAL < 80" | bc -l) )); then
echo "Coverage ${TOTAL}% is below 80% threshold"
exit 1
fi
echo "Coverage ${TOTAL}% meets 80% threshold"
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
files: ./coverage.out
flags: unittests
name: codecov-pop
- name: Lint
run: |