Add Go GitHub Actions CI workflow #3
go-ci-workflow into master Pull Request Overview
Adds a new GitHub Actions workflow to automatically run Go tests on commits and pull requests.
- Introduces
.github/workflows/go.ymlto checkout code, set up Go, and executego test - Triggers the workflow on pushes and pull requests to the default branch
Comments suppressed due to low confidence (2)
.github/workflows/go.yml:1
- [nitpick] The comment says 'build' but the workflow only runs tests; consider updating it to accurately describe testing or add a build step.
# This workflow will build a golang project
.github/workflows/go.yml:14
- [nitpick] The job is named 'build' but only runs tests; consider renaming it to 'test' for clarity or extending it to include build steps.
build:
The default branch is likely named 'main'; update this trigger to reference the correct default branch or use the repository default branch variable.
branches: [ "${{ github.event.repository.default_branch }}" ]
pull_request:
branches: [ "${{ github.event.repository.default_branch }}" ]
Same as above: ensure pull_request triggers target the correct default branch (e.g., 'main').
branches: [ "main" ]
pull_request:
branches: [ "main" ]
@ -0,0 +18,4 @@
runs-on:ubuntu-latest
steps:
- uses:actions/checkout@v4
Consider adding an actions/cache step for Go modules after checkout to speed up subsequent workflow runs.
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
$GOPATH/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
This will not be worked on
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?