Open
Conversation
crazy-max
commented
Sep 4, 2021
Comment on lines
+123
to
+124
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} |
Author
There was a problem hiding this comment.
- GitHub Actions secrets need to be created for this repo:
DOCKERHUB_USERNAME,DOCKERHUB_TOKEN.
crazy-max
commented
Sep 4, 2021
| @@ -0,0 +1,96 @@ | |||
| // Go version | |||
| variable "GO_VERSION" { | |||
| default = "1.16.3" | |||
Author
There was a problem hiding this comment.
Only one place to change Go version for your project that will be used across all targets (_common)
crazy-max
commented
Sep 4, 2021
| RUN apk add --no-cache gcc linux-headers musl-dev | ||
| WORKDIR /src | ||
|
|
||
| FROM golangci/golangci-lint:v1.37.1-alpine AS golangci-lint |
Author
There was a problem hiding this comment.
If you want to change the golangci-lint version it's here with their official Docker image.
crazy-max
commented
Sep 4, 2021
Comment on lines
+17
to
+18
| go test -v -coverprofile=/tmp/coverage.txt -covermode=atomic -race ./... && \ | ||
| go tool cover -func=/tmp/coverage.txt |
Author
There was a problem hiding this comment.
Test and coverage is done here
crazy-max
commented
Sep 4, 2021
| go tool cover -func=/tmp/coverage.txt | ||
|
|
||
| FROM scratch AS test-coverage | ||
| COPY --from=test /tmp/coverage.txt /coverage.txt |
Author
There was a problem hiding this comment.
We use a special scratch stage to export coverage result back to the host (output = ["."] in docker-bake.hcl).
crazy-max
commented
Sep 4, 2021
Comment on lines
+20
to
+24
| if [ -n "$(git status --porcelain -- go.mod go.sum)" ]; then \ | ||
| echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'; \ | ||
| git status --porcelain -- go.mod go.sum; \ | ||
| exit 1; \ | ||
| fi |
Author
There was a problem hiding this comment.
We want to make sure go.mod|sum is valid.
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
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.
@psampaz First of all thank you for this great project! Really useful!
As a modest gift, here is a PR that offers some enhancements for the current workflow:
artifact(current platform) orartifact-alltarget for cross-compilation:darwin/amd64darwin/arm64linux/amd64linux/arm/v6linux/arm/v7linux/arm64windows/amd64push tagevent semver likev0.9.0:actions/upload-artifactpsampaz/go-mod-outdated:0.9.0/psampaz/go-mod-outdated:latestpush(master branch)actions/upload-artifactpsampaz/go-mod-outdated:edgepull_requesteventactions/upload-artifactEverything is already in place and tested on https://github.com/crazy-max/go-mod-outdated as well as the GitHub Actions pipeline if you want to take a look.