Repository navigation
feat(workflows): step 7, add shared Makefile.common and drift check - #48
seantronsen wants to merge 1 commit into
Conversation
|
See OpenCHAMI/github-actions-testbed#11 for test results. |
e953668 to
d453b0d
Compare
d453b0d to
fc66a0e
Compare
fc66a0e to
e8ad694
Compare
809a949 to
c220fbf
Compare
c220fbf to
df9b46f
Compare
|
@seantronsen I'd like to split this PR before it merges. The work is good and I want to build on it, but in hindsight the approach should have started as an RFD. I've opened OpenCHAMI/roadmap#143 to work out the approach. Why not merge it and hold off on adoption? Merging here means shipping in v4.0.0 (due Nov 23): #45's release notes announce What needs discussion first:
Proposed split:
I tried this in a scratch clone. All 24 commits above this PR replayed with one conflict ( |
synackd
left a comment
There was a problem hiding this comment.
Requesting changes per comment above.
Signed-off-by: Sean Tronsen <sean.tronsen@gmail.com>
df9b46f to
5ce9505
Compare
Description
Important
This is a first draft at deduplicating Makefile recipes across the org's repos. I have notes on possible additions that I'll look at later. In the meantime, if you have questions or think something's missing, let me know.
Adds a shared
Makefile.commonfor OpenCHAMI repos and a reusable workflow that catches drift from it.Makefile.common: common targets (Go build/test/lint/vuln, Fabrica codegen, containers, GoReleaser packages, REUSE,deps, GNU-styleinstall/uninstall, help, clean) and standard variable names. Repos vendor it at their root, set overrides beforeinclude Makefile.common, and keep repo-only targets in their own Makefile.all,deps,build,run,install, anduninstallare double-colon rules so repos can extend them.make buildembeds build info into<module>/internal/version(Version, Tag, Branch, Commit, Date, GoVersion, GitState, BuildHost, BuildUser);GO_VERSION_PACKAGEorGO_LDFLAGSoverrides it. Targets that don't apply skip (nogo.mod, no Fabrica, no Containerfile); GoReleaser targets fail without a config. GNU make 3.81 compatible.lint-makefile-common.yml: reusable workflow, no inputs. Resolves this repo's latest release to its commit SHA, fetchesMakefile.commonat that SHA, and fails with a diff if the caller's copy differs.ldflagssnippet that sets the sameinternal/versionvariables, so release binaries andmake buildreport the same build info.Stacked on #47.
Downstream adoption is separate work and changes target/variable names in adopting repos (e.g.
test-coverage→coverage,rpm-build→build-packages,install(dependencies) →deps,BINARY_NAME→PROJECT/BINARIES,main.versionldflags →internal/version).Testbed: OpenCHAMI/github-actions-testbed#11.
Checklist
make test(or equivalent) locally and all tests passgit commit -s) with my real name and email<filename>.licensesidecarLICENSES/directoryType of Change