diff --git a/.github/actions/daily-perf-improver/build-steps/action.yml b/.github/actions/daily-perf-improver/build-steps/action.yml deleted file mode 100644 index b4366828764..00000000000 --- a/.github/actions/daily-perf-improver/build-steps/action.yml +++ /dev/null @@ -1,195 +0,0 @@ -name: 'Daily Perf Improver Build Steps' -description: 'Sets up the performance development environment for gh-aw' -runs: - using: "composite" - steps: - - name: Setup Environment - shell: bash - run: | - echo "=== Setting up performance development environment ===" | tee -a build-steps.log - echo "Timestamp: $(date -Iseconds)" | tee -a build-steps.log - echo "Working directory: $(pwd)" | tee -a build-steps.log - echo "" | tee -a build-steps.log - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - cache: true - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: "24" - cache: npm - cache-dependency-path: pkg/workflow/js/package-lock.json - - - name: Verify Go Installation - shell: bash - run: | - echo "=== Go Environment ===" | tee -a build-steps.log - go version | tee -a build-steps.log - echo "GOPATH: $GOPATH" | tee -a build-steps.log - echo "GOCACHE: $(go env GOCACHE)" | tee -a build-steps.log - echo "" | tee -a build-steps.log - - - name: Verify Node Installation - shell: bash - run: | - echo "=== Node Environment ===" | tee -a build-steps.log - node --version | tee -a build-steps.log - npm --version | tee -a build-steps.log - echo "" | tee -a build-steps.log - - - name: Install Go Dependencies - shell: bash - run: | - echo "=== Installing Go Dependencies ===" | tee -a build-steps.log - START_TIME=$(date +%s) - - echo "Running: go mod download" | tee -a build-steps.log - go mod download 2>&1 | tee -a build-steps.log - - echo "Running: go mod verify" | tee -a build-steps.log - go mod verify 2>&1 | tee -a build-steps.log - - echo "Running: go mod tidy" | tee -a build-steps.log - go mod tidy 2>&1 | tee -a build-steps.log - - END_TIME=$(date +%s) - DURATION=$((END_TIME - START_TIME)) - echo "✓ Go dependencies installed in ${DURATION}s" | tee -a build-steps.log - echo "" | tee -a build-steps.log - - - name: Install Go Development Tools - shell: bash - run: | - echo "=== Installing Go Development Tools ===" | tee -a build-steps.log - START_TIME=$(date +%s) - - echo "Installing gopls..." | tee -a build-steps.log - go install golang.org/x/tools/gopls@latest 2>&1 | tee -a build-steps.log - - echo "Installing actionlint..." | tee -a build-steps.log - go install github.com/rhysd/actionlint/cmd/actionlint@latest 2>&1 | tee -a build-steps.log - - echo "Installing golangci-lint binary (avoiding GPL dependencies)..." | tee -a build-steps.log - GOLANGCI_LINT_VERSION="v2.8.0" - GOOS=$(go env GOOS) - GOARCH=$(go env GOARCH) - GOPATH=$(go env GOPATH) - BINARY_NAME="golangci-lint" - - DOWNLOAD_URL="https://github.com/golangci/golangci-lint/releases/download/$GOLANGCI_LINT_VERSION/golangci-lint-${GOLANGCI_LINT_VERSION#v}-$GOOS-$GOARCH.tar.gz" - curl -sSL "$DOWNLOAD_URL" | tar -xz -C /tmp 2>&1 | tee -a build-steps.log - mkdir -p "$GOPATH/bin" - mv /tmp/golangci-lint-*/$BINARY_NAME "$GOPATH/bin/$BINARY_NAME" 2>&1 | tee -a build-steps.log - chmod +x "$GOPATH/bin/$BINARY_NAME" - - END_TIME=$(date +%s) - DURATION=$((END_TIME - START_TIME)) - echo "✓ Go tools installed in ${DURATION}s" | tee -a build-steps.log - echo "" | tee -a build-steps.log - - - name: Install npm Global Dependencies - shell: bash - run: | - echo "=== Installing npm Global Dependencies ===" | tee -a build-steps.log - START_TIME=$(date +%s) - - echo "Installing prettier..." | tee -a build-steps.log - npm install -g prettier 2>&1 | tee -a build-steps.log - - END_TIME=$(date +%s) - DURATION=$((END_TIME - START_TIME)) - echo "✓ npm global packages installed in ${DURATION}s" | tee -a build-steps.log - echo "" | tee -a build-steps.log - - - name: Install JavaScript Dependencies - shell: bash - run: | - echo "=== Installing JavaScript Dependencies ===" | tee -a build-steps.log - START_TIME=$(date +%s) - - cd pkg/workflow/js - echo "Running: npm ci" | tee -a ../../../build-steps.log - npm ci 2>&1 | tee -a ../../../build-steps.log - cd - - - END_TIME=$(date +%s) - DURATION=$((END_TIME - START_TIME)) - echo "✓ JavaScript dependencies installed in ${DURATION}s" | tee -a build-steps.log - echo "" | tee -a build-steps.log - - - name: Download GitHub Actions Schema - shell: bash - run: | - echo "=== Downloading GitHub Actions Schema ===" | tee -a build-steps.log - START_TIME=$(date +%s) - - mkdir -p pkg/workflow/schemas - curl -s -o pkg/workflow/schemas/github-workflow.json \ - "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json" \ - 2>&1 | tee -a build-steps.log - - if [ -f pkg/workflow/schemas/github-workflow.json ]; then - SIZE=$(wc -c < pkg/workflow/schemas/github-workflow.json) - echo "✓ Downloaded GitHub Actions schema (${SIZE} bytes)" | tee -a build-steps.log - else - echo "✗ Failed to download GitHub Actions schema" | tee -a build-steps.log - exit 1 - fi - - END_TIME=$(date +%s) - DURATION=$((END_TIME - START_TIME)) - echo "✓ Schema downloaded in ${DURATION}s" | tee -a build-steps.log - echo "" | tee -a build-steps.log - - - name: Build gh-aw Binary - shell: bash - run: | - echo "=== Building gh-aw Binary ===" | tee -a build-steps.log - START_TIME=$(date +%s) - - echo "Running: make build" | tee -a build-steps.log - make build 2>&1 | tee -a build-steps.log - - if [ -f ./gh-aw ]; then - SIZE=$(wc -c < ./gh-aw) - echo "✓ Built gh-aw binary (${SIZE} bytes)" | tee -a build-steps.log - ./gh-aw --version 2>&1 | tee -a build-steps.log - else - echo "✗ Failed to build gh-aw binary" | tee -a build-steps.log - exit 1 - fi - - END_TIME=$(date +%s) - DURATION=$((END_TIME - START_TIME)) - echo "✓ Binary built in ${DURATION}s" | tee -a build-steps.log - echo "" | tee -a build-steps.log - - - name: Verify Build Environment - shell: bash - run: | - echo "=== Build Environment Ready ===" | tee -a build-steps.log - echo "✓ Go: $(go version)" | tee -a build-steps.log - echo "✓ Node: $(node --version)" | tee -a build-steps.log - echo "✓ npm: $(npm --version)" | tee -a build-steps.log - echo "✓ gh-aw: $(./gh-aw --version)" | tee -a build-steps.log - echo "✓ gopls: $(gopls version 2>&1 | head -1)" | tee -a build-steps.log - echo "✓ golangci-lint: $(golangci-lint --version 2>&1 | head -1)" | tee -a build-steps.log - echo "✓ actionlint: $(actionlint --version)" | tee -a build-steps.log - echo "✓ prettier: $(prettier --version)" | tee -a build-steps.log - echo "" | tee -a build-steps.log - echo "Performance development environment ready!" | tee -a build-steps.log - echo "See build-steps.log for complete setup details" | tee -a build-steps.log - - - name: Create Performance Testing Directory - shell: bash - run: | - echo "=== Creating Performance Testing Directories ===" | tee -a build-steps.log - mkdir -p /tmp/gh-aw/perf - mkdir -p /tmp/gh-aw/benchmarks - echo "✓ Created /tmp/gh-aw/perf for performance test artifacts" | tee -a build-steps.log - echo "✓ Created /tmp/gh-aw/benchmarks for benchmark results" | tee -a build-steps.log - echo "" | tee -a build-steps.log diff --git a/.github/actions/daily-test-improver/coverage-steps/action.yml b/.github/actions/daily-test-improver/coverage-steps/action.yml deleted file mode 100644 index f699bb4786f..00000000000 --- a/.github/actions/daily-test-improver/coverage-steps/action.yml +++ /dev/null @@ -1,242 +0,0 @@ -name: 'Daily Test Coverage Steps' -description: 'Runs comprehensive test coverage analysis for gh-aw repository' -runs: - using: "composite" - steps: - # Initialize logging - - name: Initialize coverage steps log - shell: bash - run: | - echo "=== Daily Test Coverage Improver - Coverage Steps ===" | tee coverage-steps.log - echo "Started at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # Setup Go environment - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - cache: true - - - name: Log Go version - shell: bash - run: | - echo "=== Go Environment ===" | tee -a coverage-steps.log - go version | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # Setup Node.js environment for JavaScript tests - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: "24" - cache: npm - cache-dependency-path: pkg/workflow/js/package-lock.json - - - name: Log Node.js version - shell: bash - run: | - echo "=== Node.js Environment ===" | tee -a coverage-steps.log - node --version | tee -a coverage-steps.log - npm --version | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # Install Go dependencies - - name: Install Go dependencies - shell: bash - run: | - echo "=== Installing Go Dependencies ===" | tee -a coverage-steps.log - go mod download 2>&1 | tee -a coverage-steps.log - go mod verify 2>&1 | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # Install JavaScript dependencies - - name: Install JavaScript dependencies - shell: bash - run: | - echo "=== Installing JavaScript Dependencies ===" | tee -a coverage-steps.log - cd pkg/workflow/js - npm ci 2>&1 | tee -a ../../coverage-steps.log - echo "" | tee -a ../../coverage-steps.log - - # Run Go tests with coverage - - name: Run Go tests with coverage - shell: bash - run: | - echo "=== Running Go Tests with Coverage ===" | tee -a coverage-steps.log - # Run tests with coverage profile - go test -v -count=1 -timeout=5m -coverprofile=coverage.out -covermode=atomic ./... 2>&1 | tee -a coverage-steps.log - EXIT_CODE=${PIPESTATUS[0]} - echo "" | tee -a coverage-steps.log - - if [ $EXIT_CODE -ne 0 ]; then - echo "ERROR: Go tests failed with exit code $EXIT_CODE" | tee -a coverage-steps.log - exit $EXIT_CODE - fi - - # Generate Go coverage reports - - name: Generate Go coverage reports - shell: bash - run: | - echo "=== Generating Go Coverage Reports ===" | tee -a coverage-steps.log - - # Generate HTML coverage report - go tool cover -html=coverage.out -o coverage.html - echo "✓ Generated coverage.html" | tee -a coverage-steps.log - - # Generate coverage summary - echo "" | tee -a coverage-steps.log - echo "=== Go Coverage Summary ===" | tee -a coverage-steps.log - go tool cover -func=coverage.out | tee coverage-summary.txt - cat coverage-summary.txt | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # Extract overall coverage percentage - OVERALL_COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}') - echo "Overall Go Coverage: $OVERALL_COVERAGE" | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # Run JavaScript tests with coverage - - name: Run JavaScript tests with coverage - shell: bash - run: | - echo "=== Running JavaScript Tests with Coverage ===" | tee -a coverage-steps.log - cd pkg/workflow/js - npm test -- --coverage 2>&1 | tee -a ../../coverage-steps.log - EXIT_CODE=${PIPESTATUS[0]} - echo "" | tee -a ../../coverage-steps.log - - if [ $EXIT_CODE -ne 0 ]; then - echo "WARNING: JavaScript tests failed with exit code $EXIT_CODE" | tee -a ../../coverage-steps.log - echo "Continuing with Go coverage only..." | tee -a ../../coverage-steps.log - fi - - # Generate package-level coverage breakdown - - name: Generate detailed coverage breakdown - shell: bash - run: | - echo "=== Package-Level Coverage Breakdown ===" | tee -a coverage-steps.log - - # Generate package coverage summary - go tool cover -func=coverage.out | \ - grep -E "^github.com/github/gh-aw/pkg" | \ - awk '{ - # Extract package path (everything before the last colon) - idx = match($0, /:[0-9]+:/) - if (idx > 0) { - pkg = substr($1, 1, idx-1) - # Get the coverage percentage (last field) - cov = $NF - # Remove % sign and convert to number - gsub(/%/, "", cov) - sum[pkg] += cov - count[pkg]++ - } - } - END { - for (p in sum) { - avg = sum[p] / count[p] - printf "%-60s %.1f%%\n", p, avg - } - }' | sort -k2 -n | tee package-coverage.txt - - cat package-coverage.txt | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # Find lowest coverage areas - - name: Identify lowest coverage areas - shell: bash - run: | - echo "=== Functions with Lowest Coverage ===" | tee -a coverage-steps.log - echo "(Top 30 functions with lowest non-zero coverage)" | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - go tool cover -func=coverage.out | \ - grep -v "total:" | \ - grep -E "pkg/(cli|workflow|parser|console|logger)" | \ - awk '{print $3 "\t" $1 ":" $2}' | \ - grep -v "^0.0%" | \ - sort -n | \ - head -30 | \ - tee low-coverage-areas.txt - - cat low-coverage-areas.txt | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # Find zero coverage functions - - name: Identify zero coverage functions - shell: bash - run: | - echo "=== Functions with Zero Coverage ===" | tee -a coverage-steps.log - - ZERO_COUNT=$(go tool cover -func=coverage.out | grep -E "pkg/(cli|workflow|parser)" | grep "^.*0.0%" | wc -l) - echo "Total functions with 0% coverage: $ZERO_COUNT" | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - if [ $ZERO_COUNT -gt 0 ]; then - echo "Sample of zero-coverage functions (first 50):" | tee -a coverage-steps.log - go tool cover -func=coverage.out | \ - grep -E "pkg/(cli|workflow|parser)" | \ - grep "0.0%" | \ - head -50 | \ - tee zero-coverage-sample.txt - - cat zero-coverage-sample.txt | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - fi - - # Create coverage artifact directory - - name: Prepare coverage artifacts - shell: bash - run: | - echo "=== Preparing Coverage Artifacts ===" | tee -a coverage-steps.log - - mkdir -p coverage-artifacts - - # Copy all coverage files - cp coverage.out coverage-artifacts/ 2>/dev/null || true - cp coverage.html coverage-artifacts/ 2>/dev/null || true - cp coverage-summary.txt coverage-artifacts/ 2>/dev/null || true - cp package-coverage.txt coverage-artifacts/ 2>/dev/null || true - cp low-coverage-areas.txt coverage-artifacts/ 2>/dev/null || true - cp zero-coverage-sample.txt coverage-artifacts/ 2>/dev/null || true - cp coverage-steps.log coverage-artifacts/ 2>/dev/null || true - - # Copy JavaScript coverage if it exists - if [ -d "pkg/workflow/js/coverage" ]; then - cp -r pkg/workflow/js/coverage coverage-artifacts/js-coverage 2>&1 | tee -a coverage-steps.log || true - fi - - echo "✓ Coverage artifacts prepared in coverage-artifacts/" | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # List what we're uploading - echo "Files to be uploaded:" | tee -a coverage-steps.log - ls -lh coverage-artifacts/ | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - - # Upload coverage artifacts - - name: Upload coverage artifacts - uses: actions/upload-artifact@v4 - with: - name: coverage - path: coverage-artifacts/ - retention-days: 30 - - # Final summary - - name: Coverage steps completed - shell: bash - run: | - echo "=== Coverage Steps Completed ===" | tee -a coverage-steps.log - echo "Completed at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log - echo "Coverage artifacts have been uploaded as 'coverage' artifact" | tee -a coverage-steps.log - echo "Download the artifact to view:" | tee -a coverage-steps.log - echo " - coverage.html: Interactive HTML coverage report" | tee -a coverage-steps.log - echo " - coverage.out: Raw coverage data for tools" | tee -a coverage-steps.log - echo " - coverage-summary.txt: Function-level coverage summary" | tee -a coverage-steps.log - echo " - package-coverage.txt: Package-level breakdown" | tee -a coverage-steps.log - echo " - low-coverage-areas.txt: Functions needing attention" | tee -a coverage-steps.log - echo " - zero-coverage-sample.txt: Sample of uncovered functions" | tee -a coverage-steps.log - echo " - coverage-steps.log: This log file" | tee -a coverage-steps.log - echo "" | tee -a coverage-steps.log