-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport of [NET-3029] Migrate build-distros to GHA into release/1.14…
….x (#16717) * [NET-3029] Migrate build-distros to GHA (#16669) * migrate build distros to GHA Signed-off-by: Dan Bond <danbond@protonmail.com> * build-arm Signed-off-by: Dan Bond <danbond@protonmail.com> * don't use matrix Signed-off-by: Dan Bond <danbond@protonmail.com> * check-go-mod Signed-off-by: Dan Bond <danbond@protonmail.com> * add notify slack script Signed-off-by: Dan Bond <danbond@protonmail.com> * notify slack if failure Signed-off-by: Dan Bond <danbond@protonmail.com> * rm notify slack script Signed-off-by: Dan Bond <danbond@protonmail.com> * fix check-go-mod job Signed-off-by: Dan Bond <danbond@protonmail.com> --------- Signed-off-by: Dan Bond <danbond@protonmail.com> * Manually fix build.yml bug Signed-off-by: Dan Bond <danbond@protonmail.com> * [NET-3029] Migrate build-distros to GHA (#16669) * migrate build distros to GHA Signed-off-by: Dan Bond <danbond@protonmail.com> * build-arm Signed-off-by: Dan Bond <danbond@protonmail.com> * don't use matrix Signed-off-by: Dan Bond <danbond@protonmail.com> * check-go-mod Signed-off-by: Dan Bond <danbond@protonmail.com> * add notify slack script Signed-off-by: Dan Bond <danbond@protonmail.com> * notify slack if failure Signed-off-by: Dan Bond <danbond@protonmail.com> * rm notify slack script Signed-off-by: Dan Bond <danbond@protonmail.com> * fix check-go-mod job Signed-off-by: Dan Bond <danbond@protonmail.com> --------- Signed-off-by: Dan Bond <danbond@protonmail.com> * Manually fix build.yml bug Signed-off-by: Dan Bond <danbond@protonmail.com> * remove whitespace Signed-off-by: Dan Bond <danbond@protonmail.com> --------- Signed-off-by: Dan Bond <danbond@protonmail.com>
- Loading branch information
1 parent
9021e0c
commit e23e2fc
Showing
2 changed files
with
98 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# NOTE: this workflow builds Consul binaries on multiple architectures for PRs. | ||
# It is aimed at checking new commits don't introduce any breaking build changes. | ||
name: build-distros | ||
|
||
on: [pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check-go-mod: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0 | ||
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0 | ||
with: | ||
go-version-file: 'go.mod' | ||
- run: go mod tidy | ||
- run: | | ||
if [[ -n $(git status -s) ]]; then | ||
echo "Git directory has changes" | ||
git status -s | ||
exit 1 | ||
fi | ||
build-386: | ||
needs: check-go-mod | ||
env: | ||
XC_OS: "freebsd linux windows" | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0 | ||
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0 | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: Build | ||
run: | | ||
for os in $XC_OS; do | ||
GOOS="$os" GOARCH=386 CGO_ENABLED=0 go build | ||
done | ||
build-amd64: | ||
needs: check-go-mod | ||
env: | ||
XC_OS: "darwin freebsd linux solaris windows" | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0 | ||
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0 | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: Build | ||
run: | | ||
for os in $XC_OS; do | ||
GOOS="$os" GOARCH=amd64 CGO_ENABLED=0 go build | ||
done | ||
build-arm: | ||
needs: check-go-mod | ||
runs-on: ubuntu-22.04 | ||
env: | ||
CGO_ENABLED: 1 | ||
GOOS: linux | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0 | ||
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0 | ||
with: | ||
go-version-file: 'go.mod' | ||
- run: | | ||
sudo rm -fv /etc/apt/sources.list.d/github_git-lfs.list # workaround for https://github.com/actions/runner-images/issues/1983 | ||
sudo apt-get update --allow-releaseinfo-change-suite --allow-releaseinfo-change-version && sudo apt-get install -y gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu | ||
- run: CC=arm-linux-gnueabi-gcc GOARCH=arm GOARM=5 go build | ||
- run: CC=arm-linux-gnueabihf-gcc GOARCH=arm GOARM=6 go build | ||
- run: CC=aarch64-linux-gnu-gcc GOARCH=arm64 go build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters