Add Github action for build and test supporting multi-arch - #130
Conversation
|
This looks like great work, thanks @desaiuditd I'm reviewing it and will see how it runs etc, but hopefully we can merge it soon |
I don't mind if it zip files or tar files, whichever is easier to implement.
This is fine, I like the idea of statically linked binaries, if it means that users don't have to worry about having the right version of some libraries on their system, but if the build system doesn't support it then I guess we just use dynamic binaries and move on |
Eventually I ended up copying what was already done in hledger repo. They are doing tar files. So tar it is. |
|
@desaiuditd Thanks for contributing the Github Action, I think it will make releases a bit easier. Would you like to add submit a PR adding your name to the list of contributors? I'll do a minor release in a day or so, then we can also test what happens when a tag gets pushed |
|
@desaiuditd The release worked very well, all artifacts were automatically attached. Thanks! https://github.com/apauley/hledger-flow/releases/tag/v0.16.2 |
|
@apauley Awesome! 🎉 |
|
@desaiuditd Glad to hear. How are you using hledger-flow that made you need this? You mentioned something about docker, while I think most people just run the binary directly on their host OS |
|
@apauley On the contrary, I prefer to use Docker containers on my host machine as much as possible. This is personal preference though. I understand not everyone wants to do that. Using Docker gives me consistent, isolated, reproducible and ephemeral environments to run my tools without polluting my host machine. So I've got a custom docker image with hledger and hledger-flow installed combined. Which I use daily to perform my hledger specific tasks. |
Attempts to fix #129
Platform/Architecture supported:
linux-x64linux-arm64(ARM machines - Raspberry Pi etc.)macos-x64(Intel)macos-arm64(Apple Silicon)hledger steps in the pipeline are skipped for
linux-arm64platform.Because
hledgeralso doesn't support it yet. We can add it later, if needed.The compilation and build is kept with dynamic linking as-is. Static linking was giving hard trouble during build time.
Workflow runs on
masterbranch and all PRs raised againstmasterbranch.Basic support for cache is added for build and package files:
ghcupstackReferenced from https://github.com/simonmichael/hledger/blob/master/.github/workflows/ci.yml#L133-L176
This can be improved here in this repo by linking the cache with ghc or stack resolver version. We can optimise it later, if needed.
For now, I did not want to hardcode Stack resolver version in the Github Action which is also declared in
stack.yamlfile.The steps in the build job loosely follow what was already done in
.circleci/config.ymlfile.Last two steps in the job uploads the binary as artifact on the Github Action Job. Which can be downloaded as zip.
A release job is also added to create Github Release automatically.
Will trigger automatically after build-and-test, when a new tag is pushed manually.
E.g., https://github.com/desaiuditd/hledger-flow/releases/tag/v0.16.1
Binaries generated from the build job: