mpalmer / action-validator

Tool to validate GitHub Action and Workflow YAML files
GNU General Public License v3.0
277 stars 23 forks source link

Release arm/arm64 versions of this tool #10

Closed mathew-fleisch closed 1 year ago

mathew-fleisch commented 2 years ago

I'd like to use this tool directly in a github-action on a self-hosted runner that is hosted on a raspberry pi. This requires compiling the tool for the arm64 system architecture. However, I am not familiar with rust and how to add this into your release pipeline. Once that change is made, I'd also like to update the asdf install script to use uname -m to detect the system arch, and install the correct version, for each host ( example ). Can you point me in the right direction?

Here's the error

$ uname -m
aarch64

$ uname   
Linux

$ action-validator 
/lib64/ld-linux-x86-64.so.2: No such file or directory
mpalmer commented 2 years ago

So there's two (at least) parts to this:

  1. Compiling for aarch64 (and other ARM platforms), which may be able to be done with cross-compilation, or which may be a complete clusterfudge because GitHub actions only supports x86_64 runners; and
  2. Teaching the asdf installer to detect the system architecture and download the appropriate binary, which is relatively straightforward -- just whack an extra layer of if statement in get_platform to call uname -m and modify the return value appropriately. Bonus points for having fallback cases that return errors when an unsupported OS/arch is found, rather than the current situation where we just blindly download completely the wrong binaries.
mpalmer commented 1 year ago

I've modified the release process to build arm64 binaries, and updated the asdf plugin to detect when it's running on an arm64 system. The binaries appear to be building OK, but as I don't have an arm64 system to test with, I can't be sure whether (a) the binaries actually work, or (b) the changes to the asdf plugin are correct. If either of those things are broken, re-open this and I'll fix.