Skip to content

Comments

Add GitHub Actions CI workflow for build, lint, and test#5

Merged
theFong merged 2 commits intomainfrom
devin/1754373573-add-github-actions
Aug 5, 2025
Merged

Add GitHub Actions CI workflow for build, lint, and test#5
theFong merged 2 commits intomainfrom
devin/1754373573-add-github-actions

Conversation

@devin-ai-integration
Copy link
Contributor

Add GitHub Actions CI workflow for build, lint, and test

Summary

Adds a comprehensive GitHub Actions CI workflow that leverages the existing Makefile targets to build, lint, and test the Go project. The workflow includes:

  • Test & Lint Job: Runs make check (combines lint, vet, fmt-check, test), security scanning with gosec, and generates test coverage reports
  • Cross-platform Build Job: Uses matrix strategy to build for Linux, macOS, and Windows using make build-{target}
  • Caching: Go modules caching for faster builds
  • Artifacts: Uploads coverage reports and build artifacts for each platform

The workflow uses Go 1.23.0 (matching go.mod) and runs on pushes to main and all pull requests.

Review & Testing Checklist for Human

  • Run this workflow on GitHub Actions - Most critical: verify all jobs actually pass in the CI environment (local testing doesn't guarantee CI compatibility)
  • Review security scanning behavior - I added continue-on-error: true for gosec due to local network issues. Decide if this is appropriate or if security failures should block CI
  • Check cross-platform build artifacts - Verify that the matrix builds actually produce and upload artifacts for all three platforms (Linux, macOS, Windows)
  • Test on a real PR - Create a test PR to see the full workflow execution and artifact generation

Recommended test plan: Create a small test PR with a trivial change to trigger this workflow and verify all steps complete successfully.


Diagram

%%{ init : { "theme" : "default" }}%%
graph TB
    subgraph "GitHub Actions Workflow"
        W["ci.yml<br/>New CI Workflow"]:::major-edit
    end
    
    subgraph "Existing Makefile Targets"
        MC["make check<br/>(lint, vet, fmt-check, test)"]:::context
        MS["make security<br/>(gosec scan)"]:::context
        MTC["make test-coverage<br/>(coverage reports)"]:::context
        MBA["make build-all<br/>(cross-platform builds)"]:::context
    end
    
    subgraph "Project Files"
        GM["go.mod<br/>(Go 1.23.0 version)"]:::context
        GC[".golangci.yml<br/>(linter config)"]:::context
    end
    
    W -->|"uses"| MC
    W -->|"uses"| MS
    W -->|"uses"| MTC
    W -->|"uses"| MBA
    W -->|"reads version from"| GM
    MC -->|"configured by"| GC
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit  
        L3[Context/No Edit]:::context
    end

classDef major-edit fill:#90EE90
classDef minor-edit fill:#87CEEB
classDef context fill:#FFFFFF
Loading

Notes

  • The workflow was tested locally using the same Makefile targets, but CI environments can have subtle differences
  • Security scanning step includes continue-on-error: true due to gosec installation issues during local testing - this prevents security scan failures from blocking the entire workflow
  • All existing Makefile targets were preserved and reused to maintain consistency with local development workflow
  • Go module caching should significantly speed up subsequent CI runs

Link to Devin run: https://app.devin.ai/sessions/8411b71869434c6099591b2fde02c9aa
Requested by: @theFong

- Add comprehensive CI workflow with build, lint, and test jobs
- Use Go 1.23.0 as specified in go.mod
- Leverage existing Makefile targets (make check, make build-all)
- Include cross-platform builds for Linux, macOS, and Windows
- Add test coverage reporting and artifact uploads
- Include security scanning with gosec (continue-on-error)
- Cache Go modules for faster builds

Co-Authored-By: Alec Fong <alecsanf@usc.edu>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

- Update actions/cache from v3 to v4
- Update actions/upload-artifact from v3 to v4
- Resolves CI failure due to deprecated action versions

Co-Authored-By: Alec Fong <alecsanf@usc.edu>
@theFong theFong merged commit 07ecce6 into main Aug 5, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant