-
Notifications
You must be signed in to change notification settings - Fork 0
feat(gotester): added gotester for go build speedups #14
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
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| FROM golang:1.25-alpine | ||
|
|
||
| # System dependencies needed by both go-test and mock-tester CI workflows: | ||
| # bash - shell scripts in CI steps | ||
| # bc - floating-point coverage threshold comparison | ||
| # curl - downloading tools (Atlas CLI) | ||
| # git - Go modules, golangci-lint VCS checks | ||
| # grep - GNU grep with -P (PCRE) for extracting coverage thresholds | ||
| # make - mock service Makefiles | ||
| # postgresql17-client - pg_isready to wait for Postgres service containers | ||
| RUN apk add --no-cache \ | ||
| bash \ | ||
| bc \ | ||
| curl \ | ||
| git \ | ||
| grep \ | ||
| make \ | ||
| postgresql17-client | ||
|
|
||
| # golangci-lint v2.5.0 — used by both mock-tester and linting workflows | ||
| # Installed from versioned release artifact with checksum verification. | ||
| ARG GOLANGCI_LINT_VERSION=2.5.0 | ||
| ARG GOLANGCI_LINT_SHA256=c77313a77e19b06123962c411d9943cc0d092bbec76b956104d18964e274902e | ||
| RUN curl -sSfL "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" \ | ||
| -o /tmp/golangci-lint.tar.gz \ | ||
| && echo "${GOLANGCI_LINT_SHA256} /tmp/golangci-lint.tar.gz" | sha256sum -c - \ | ||
| && tar -xzf /tmp/golangci-lint.tar.gz -C /tmp \ | ||
| && mv /tmp/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint /usr/local/bin/ \ | ||
| && rm -rf /tmp/golangci-lint* | ||
|
|
||
| # Atlas CLI — generates test migrations for backend/pacioli database schemas | ||
| # Pinned to a specific version via ATLAS_VERSION; bump the ARG to upgrade. | ||
| ARG ATLAS_VERSION=v1.2.0 | ||
| RUN ATLAS_VERSION=${ATLAS_VERSION} curl -sSf https://atlasgo.sh | sh | ||
|
|
||
| WORKDIR /app |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Go Tester | ||
|
|
||
| Pre-built image for running Go unit tests, mock-service tests, and linting in the [interledger-app](https://github.com/interledger/interledger-app) CI pipeline. | ||
|
|
||
| ## What's inside | ||
|
|
||
| | Tool | Version | Purpose | | ||
| |------|---------|---------| | ||
| | Go | 1.25 | Compile and test Go code | | ||
| | golangci-lint | 2.5.0 | Lint all Go packages | | ||
| | Atlas CLI | 1.2.0 | Generate database test migrations | | ||
| | PostgreSQL 17 client | 17.x | `pg_isready` to wait for Postgres service containers | | ||
| | GNU grep (PCRE) | — | Extract coverage thresholds with `-oP` | | ||
| | bc | — | Floating-point coverage comparison | | ||
| | make | — | Run mock-service Makefiles | | ||
| | bash, git, curl | — | Standard CI utilities | | ||
|
|
||
| ## Replaces | ||
|
|
||
| This single image replaces the tool-installation steps in two interledger-app workflow templates: | ||
|
|
||
| - **`go-test-template.yml`** — `setup-go`, `Install Atlas CLI`, `pg_isready` wait loop | ||
| - **`mock-tester.yml`** — `setup-go`, `golangci-lint-action`, Docker setup | ||
|
|
||
| ## Usage | ||
|
|
||
| ```yaml | ||
| # GitHub Actions example | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/interledger/builders/gotester:latest | ||
| services: | ||
| postgres: | ||
| image: postgres:17 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - run: go test -coverprofile=coverage.out ./go/backend/... | ||
| ``` | ||
|
|
||
| ## Building locally | ||
|
|
||
| ```bash | ||
| cd gotester | ||
| docker build -t gotester . | ||
| ``` | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.