Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Build binary outside Dockerfile#121

Merged
hnnsgstfssn merged 5 commits intomainfrom
build-in-workflow
May 28, 2025
Merged

Build binary outside Dockerfile#121
hnnsgstfssn merged 5 commits intomainfrom
build-in-workflow

Conversation

@hnnsgstfssn
Copy link
Contributor

Description

The build takes a ton of time and this attempts to improve the status quo.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@hnnsgstfssn
Copy link
Contributor Author

/publish

@github-actions
Copy link

oci-image-publish-on-comment: failed ❌
https://github.com/commercetools/telefonistka/actions/runs/15121885411
ghcr.io/commercetools/telefonistka:build-in-workflow
ghcr.io/commercetools/telefonistka:sha-a8b8a29

@Oded-B
Copy link
Collaborator

Oded-B commented May 20, 2025

OMG its 9 minutes 😱
looking at https://github.com/commercetools/telefonistka/actions/runs/15125128415/job/42515678130

make test: 174.4s
#19 exporting to GitHub Actions Cache (?) 230.0s(!)
RUN make build 127.8s (~ 80% is go build command , the rest is go mod download )
😱 😱 😱

These test/build times are very high, if we assume its mostly fetching the dep's then using the cache correctly(based on go.sum hash) , like this: https://danp.net/posts/github-actions-go-cache/ will make a substantial change, but I'm not sure its the case.

@hnnsgstfssn
Copy link
Contributor Author

/publish

@github-actions
Copy link

oci-image-publish-on-comment: failed ❌
https://github.com/commercetools/telefonistka/actions/runs/15165353455
ghcr.io/commercetools/telefonistka:build-in-workflow
ghcr.io/commercetools/telefonistka:sha-f5a1026

By adding workflow_dispatch as a trigger it is possible to execute the
workflow using the Github CLI. Without it, does not seem it is possible
to run on a non-main branch.
It is not clear what they are used for if anything as they do not
actually push any image.

For clarity they are dropped.
The build takes a ton of time and this attempts to improve the status
quo by building the binary outside of Docker.

By adding Go build steps and caching of dependencies and build artifacts
build time is reduced from about 10m to 1m.
@hnnsgstfssn hnnsgstfssn marked this pull request as ready for review May 21, 2025 15:39
@hnnsgstfssn hnnsgstfssn requested a review from a team as a code owner May 21, 2025 15:39
@hnnsgstfssn
Copy link
Contributor Author

Using the comment flow fails now because it does not include branch changes to the workflow when running, but is running against the branch Dockerfile.

The other job succeeds and should prove it's working.

@hnnsgstfssn hnnsgstfssn changed the title Try building outside Dockerfile Build binary outside Dockerfile May 21, 2025
@hnnsgstfssn hnnsgstfssn requested a review from Oded-B May 21, 2025 15:42
@hnnsgstfssn hnnsgstfssn requested a review from Oded-B May 27, 2025 22:25
@hnnsgstfssn hnnsgstfssn merged commit 7bfd984 into main May 28, 2025
10 checks passed
@hnnsgstfssn hnnsgstfssn deleted the build-in-workflow branch May 28, 2025 11:53
@Ben10k Ben10k mentioned this pull request Oct 29, 2025
2 tasks
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.

2 participants