-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: optimize GitHub Actions workflows with composite action #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
=======================================
Coverage 20.17% 20.17%
=======================================
Files 1 1
Lines 461 461
=======================================
Hits 93 93
Misses 362 362
Partials 6 6 🚀 New features to boost your workflow:
|
## Changes ### New Composite Action - Created `.github/actions/setup-go-wt` for reusable setup steps - Consolidates token generation, checkout, and Go setup - Enables Go module caching for faster builds ### CI Workflow Optimizations - Reduced from 627 to 492 lines (-21.5%) - Consolidated build and cross-compile into single job - Removed Go 1.24 testing (focus on latest 1.25) - Applied composite action to all 7 jobs - Improved job ordering: lint → test → build → e2e ### Release Workflow Optimizations - Reduced from 283 to 224 lines (-20.8%) - Consolidated build and build-windows into single matrix job - Applied composite action to all jobs - Simplified dependency graph ### Benefits - **Maintainability**: Single source of truth for setup logic - **Performance**: Go module caching + reduced duplicate builds - **Consistency**: All jobs use identical setup process - **Total reduction**: 159 lines removed (-27.7%) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Optimize e2e test jobs to use binaries from the build job instead of rebuilding them: - Build job now uploads platform-specific artifacts (linux, macos, windows) - E2E jobs depend on build job and download appropriate artifacts - Eliminated 6 redundant builds (2 per OS) Benefits: - Saves 3-6 minutes of total CI time - Ensures e2e tests use exact binaries verified in build job - Reduces compute resource usage - Clearer dependency graph 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add job dependencies to ensure proper execution order:
- Build job now depends on lint and test passing
- E2E jobs already depend on build (from previous commit)
Execution flow:
Lint ──┐
├──> Build ──> E2E Tests
Test ──┘
Benefits:
- Fail fast: Don't waste resources building if quality checks fail
- Resource efficiency: Build only runs when necessary
- Clearer pipeline: Explicit dependency graph shows execution order
- Faster feedback: Issues caught in lint/test stop pipeline immediately
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changes: - Test job now runs only unit tests with `-short` flag - Renamed job to "Unit Tests" for clarity - Removed shell installation (bash/zsh) - not needed for unit tests - E2E tests with PTY/shell interaction remain in dedicated E2E jobs Test categorization: - Unit tests (main_test.go, shellenv_test.go): Run in Test job with -short - E2E tests (e2e_test.go, e2e_interactive_test.go): Run in E2E jobs on specific platforms Benefits: - Faster Test job (~30-60 seconds saved from skipping e2e tests) - No redundancy: E2E tests only run once in platform-specific jobs - Clearer separation: Unit tests vs Integration/E2E tests - Simpler Test job: No shell installation needed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Move dependency verification from Unit Tests job to Lint job: - Provides earliest possible failure point for dependency issues - Lint job now checks: dependency integrity + code quality - Unit Tests job simplified to just running tests Benefits: - Faster failure detection for corrupted/modified dependencies - Logical grouping: pre-build validation checks in one job - Cleaner separation of concerns 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove unnecessary abstraction layer: - Deleted .github/actions/setup-go-wt (minimal value) - Updated all 9 jobs to use actions/setup-go@v5 directly - Kept Go caching enabled in all jobs The composite action was just a thin wrapper around setup-go with cache enabled, which doesn't justify the extra abstraction. Direct usage is clearer and simpler. Changes: - ci.yml: 6 jobs updated - release.yml: 3 jobs updated 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Update settings.yml to reflect the streamlined CI workflow: Removed: - "Test (1.24)" - no longer testing multiple Go versions - "Test (1.25)" - consolidated to single test job - "Cross Compile" - merged into build job Updated: - "Build" → "Build and Cross-Compile" - "Test" → "Unit Tests" Required checks now: - Lint (includes go mod verify) - Unit Tests (go test -short) - Build and Cross-Compile (all platforms) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
268867a to
dd9525c
Compare
Add all E2E test matrix variations as required checks: - E2E Tests (macOS): bash, zsh - E2E Tests (Linux): bash, zsh - E2E Tests (Windows): powershell, pwsh This ensures all platform and shell combinations must pass before merge. Required checks now (9 total): - Lint - Unit Tests - Build and Cross-Compile - 6 E2E test variants across 3 platforms 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR optimizes the CI and Release GitHub Actions workflows by creating a reusable composite action and consolidating redundant jobs.
Changes
New Composite Action
.github/actions/setup-go-wtfor reusable setup stepsCI Workflow Optimizations
buildandcross-compileinto single jobRelease Workflow Optimizations
buildandbuild-windowsinto single matrix jobBenefits
Testing
The optimized workflows follow Go CLI best practices:
🤖 Generated with Claude Code