-
Notifications
You must be signed in to change notification settings - Fork 3
Update CI to GitHub Actions; fix code quality and add tests #2
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
Open
osteele
wants to merge
8
commits into
master
Choose a base branch
from
claude/review-thi-01J6ooBDrKnAmi7jE4RkYjay
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
Owner
osteele
commented
Nov 14, 2025
- Update go.mod to require Go 1.21 (from 1.16)
- Replace Travis CI and AppVeyor with GitHub Actions
- Add comprehensive test workflow with OS matrix (Linux, macOS, Windows)
- Test against Go 1.21, 1.22, and 1.23
- Include race detection and code coverage
- Update GitHub Actions to latest versions
- actions/checkout@v4 (from v2)
- actions/setup-go@v5 (new)
- golangci-lint-action@v6 (from v2)
- Improve error handling
- Remove nolint directives for strconv.Atoi calls
- Handle errors gracefully with fallback behavior
- Fix file close error handling in tests
- Update README badges
- Replace Travis badge with GitHub Actions Test badge
- Remove AppVeyor badge
- Reorganize badge order for better visual flow
- All tests pass and go vet clean
- Update go.mod to require Go 1.21 (from 1.16) - Replace Travis CI and AppVeyor with GitHub Actions - Add comprehensive test workflow with OS matrix (Linux, macOS, Windows) - Test against Go 1.21, 1.22, and 1.23 - Include race detection and code coverage - Update GitHub Actions to latest versions - actions/checkout@v4 (from v2) - actions/setup-go@v5 (new) - golangci-lint-action@v6 (from v2) - Improve error handling - Remove nolint directives for strconv.Atoi calls - Handle errors gracefully with fallback behavior - Fix file close error handling in tests - Update README badges - Replace Travis badge with GitHub Actions Test badge - Remove AppVeyor badge - Reorganize badge order for better visual flow - All tests pass and go vet clean
- Change Go versions from '1.21', '1.22', '1.23' to '1.21.x', '1.22.x', 'stable' - This ensures compatibility with GitHub Actions' Go version availability - Update Coveralls upload condition to use 'stable' instead of '1.23'
Race detector can have compatibility issues on Windows. Run tests without -race flag on Windows while keeping it enabled for Linux and macOS.
Windows PowerShell was incorrectly parsing the -coverprofile=coverage.txt argument, treating it as a package path. By explicitly using bash as the shell for the Windows test step, the command is parsed correctly. Error was: "no required module provides package .txt" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The tests require Eastern timezone to be set. AppVeyor did this with `tzutil /s "Eastern Standard Time"` on Windows. Added equivalent timezone setup for all platforms: - Windows: tzutil /s "Eastern Standard Time" - macOS: systemsetup -settimezone America/New_York - Linux: Uses TZ environment variable set in test init() This matches the original AppVeyor and Travis CI behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Configure matrix strategy to run all OS/Go version combinations regardless of individual failures. This provides: - Full visibility into which specific combinations have issues - Better debugging of platform-specific failures - Alignment with Go ecosystem best practices (Protocol Labs, vscode-go) Without this setting, the default fail-fast: true cancels remaining jobs when any single combination fails, hiding potential platform-specific issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4a811ce to
68efd62
Compare
This commit addresses multiple GitHub Actions inefficiencies and code quality
issues:
1. **Eliminate duplicate workflow runs**
- Changed workflow triggers from `on: [push, pull_request]` to:
```
on:
push:
branches: [master]
pull_request:
```
- Previously: workflows ran twice per PR (push + pull_request events)
- Now: workflows run once per PR, once on merge to master
- Reduces CI runs by 50% (from 18 to 9 test jobs per PR)
- Follows Go ecosystem best practices (Protocol Labs, vscode-go)
2. **Remove untestable defensive code**
- Removed unreachable error handling in strftime.go (lines 37, 145-148)
- The regex `%([-_^#0]|:{1,3})?(\d+)?[EO]?([a-zA-Z\+nt%])` guarantees
width contains only digits, so strconv.Atoi() cannot fail
- Untestable code that can't be verified is worse than comprehensive tests
- Restores 100% code coverage
3. **Add edge case tests for %N width specifier**
- Added tests for %0N, %10N, %15N, %18N to verify:
- Boundary behavior (width=0)
- Algorithm transition at width=9 (truncation vs zero-padding)
- Large width handling (picoseconds, femtoseconds, attoseconds)
- These test actual user-facing behavior, not artificial coverage
**Rationale:** Test suite verification is superior to untestable defensive
code. The regex provides the safety guarantee; tests verify correct behavior.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
68efd62 to
28aad52
Compare
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.