Make CI cross-compile lf for every supported platform; support darwin-arm64 (#1298)

* Create CI job to run `gen/xbuild.sh`, adjust `xbuild.sh` to make it possible

This reworks the gen/xbuild.sh script to exit with a failure if any of the targets don't compile. It also adds a CI job to try cross-compiling for every platform on every pull request.

The new check is a little slow and compute-expensive, but I am hoping it's well within the quota.

See #1299 for a demo of how the CI would have failed after #1288 and before #1295.

Screenshot: https://github.com/gokcehan/lf/assets/4123047/3d7a6b7c-8642-4d4c-a98a-c8b886c0b184

Thanks to @joelim-work for numerous improvements and an alternate
implementation I heavily borrowed from
(https://github.com/joelim-work/lf/blob/ci/gen/xbuild.sh)

* Refactor xbuild.sh some more to decrease repetition

I can remove this commit if people prefer.

* Generate darwin-arm64 binaries as we have users using it

Arm Macs are becoming popular. We have at least one
user: https://github.com/gokcehan/lf/issues/1294. It
seems lf works fine there.
This commit is contained in:
Ilya Grigoriev authored and GitHub committed 2023-07-03 13:08:12 +03:00
1 parent b1a851953b
commit c11931d3e6
2 files changed
+92 -43

No files matched your search

+16 -1
View File
@@ -8,7 +8,7 @@ on:
jobs:
build:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
@@ -34,6 +34,21 @@ jobs:
version: "2022.1.3"
install-go: false
cross-compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.18
- name: Cross-compile on all supported platforms
run: gen/xbuild.sh
generate:
runs-on: ubuntu-latest
steps: