Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions .github/actions/daily-test-improver/coverage-steps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,67 @@ runs:
steps:
# Step 1: Setup Go environment
- name: ⚙️ Setup Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: go.mod

# Step 2: Verify Go installation
- name: ✅ Verify Go setup
shell: bash
run: |
echo "Setting up Go environment..." | tee -a coverage-steps.log
echo "Verifying Go environment..." | tee -a coverage-steps.log
go version | tee -a coverage-steps.log
echo "✅ Go setup complete" | tee -a coverage-steps.log

# Step 2: Download dependencies
# Step 3: Download dependencies
- name: 📦 Download Go modules
shell: bash
run: |
echo "Downloading Go modules..." | tee -a coverage-steps.log
go mod download 2>&1 | tee -a coverage-steps.log
echo "✅ Go modules downloaded" | tee -a coverage-steps.log

# Step 3: Build the KSail binary
# Step 4: Build the KSail binary
- name: 🏗️ Build KSail binary
shell: bash
run: |
echo "Building KSail binary..." | tee -a coverage-steps.log
go build -o ksail . 2>&1 | tee -a coverage-steps.log
echo "✅ Build successful" | tee -a coverage-steps.log

# Step 4: Enable covdata workaround
# Step 5: Enable covdata workaround
- name: 👨🏻‍🔧 Enable covdata
shell: bash
run: |
echo "Enabling covdata workaround..." | tee -a coverage-steps.log
go env -w GOTOOLCHAIN=go1.25.4+auto 2>&1 | tee -a coverage-steps.log
echo "✅ Covdata enabled" | tee -a coverage-steps.log

# Step 5: Run unit tests with coverage
# Step 6: Run unit tests with coverage
- name: 📊 Run tests and generate coverage
shell: bash
run: |
echo "Running tests with coverage..." | tee -a coverage-steps.log
go test -race -coverprofile=coverage.txt -covermode=atomic ./... 2>&1 | tee -a coverage-steps.log
echo "✅ Tests complete, coverage generated at: coverage.txt" | tee -a coverage-steps.log

# Step 6: Display coverage summary
# Step 7: Display coverage summary
- name: 📈 Display coverage summary
shell: bash
run: |
echo "Coverage summary by package:" | tee -a coverage-steps.log
go tool cover -func=coverage.txt 2>&1 | tee -a coverage-steps.log
echo "✅ Coverage summary complete" | tee -a coverage-steps.log

# Step 7: Generate HTML coverage report
# Step 8: Generate HTML coverage report
- name: 📄 Generate HTML coverage report
shell: bash
run: |
echo "Generating HTML coverage report..." | tee -a coverage-steps.log
go tool cover -html=coverage.txt -o coverage.html 2>&1 | tee -a coverage-steps.log
echo "✅ HTML coverage report generated at: coverage.html" | tee -a coverage-steps.log

# Step 8: Upload coverage artifacts
# Step 9: Upload coverage artifacts
- name: 📤 Upload coverage reports
uses: actions/upload-artifact@ea054b56044de43c62e384c6396ee2371e6d0e4b # v4.6.2
with:
Expand Down