-
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.
Merge branch 'main' into jm/rmv-go-tests
- Loading branch information
Showing
18 changed files
with
507 additions
and
105 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
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
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
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 |
---|---|---|
|
@@ -2,11 +2,20 @@ | |
# It is aimed at checking new commits don't introduce any breaking build changes. | ||
name: build-distros | ||
|
||
on: [pull_request] | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
# Push events on the main branch | ||
- main | ||
- release/** | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
GOTAGS: ${{ endsWith(github.repository, '-enterprise') && 'consulent' || '' }} | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
|
@@ -38,7 +47,7 @@ jobs: | |
- check-go-mod | ||
env: | ||
XC_OS: "freebsd linux windows" | ||
runs-on: ${{ fromJSON(needs.setup.outputs.compute-medium) }} | ||
runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected] | ||
|
||
|
@@ -53,7 +62,7 @@ jobs: | |
- name: Build | ||
run: | | ||
for os in $XC_OS; do | ||
GOOS="$os" GOARCH=386 CGO_ENABLED=0 go build | ||
GOOS="$os" GOARCH=386 CGO_ENABLED=0 go build -tags "${{ env.GOTAGS }}" | ||
done | ||
build-amd64: | ||
|
@@ -62,7 +71,7 @@ jobs: | |
- check-go-mod | ||
env: | ||
XC_OS: "darwin freebsd linux solaris windows" | ||
runs-on: ${{ fromJSON(needs.setup.outputs.compute-medium) }} | ||
runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected] | ||
|
||
|
@@ -77,14 +86,14 @@ jobs: | |
- name: Build | ||
run: | | ||
for os in $XC_OS; do | ||
GOOS="$os" GOARCH=amd64 CGO_ENABLED=0 go build | ||
GOOS="$os" GOARCH=amd64 CGO_ENABLED=0 go build -tags "${{ env.GOTAGS }}" | ||
done | ||
build-arm: | ||
needs: | ||
- setup | ||
- check-go-mod | ||
runs-on: ${{ fromJSON(needs.setup.outputs.compute-medium) }} | ||
runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }} | ||
env: | ||
CGO_ENABLED: 1 | ||
GOOS: linux | ||
|
@@ -103,6 +112,35 @@ jobs: | |
- run: | | ||
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 | ||
- run: CC=arm-linux-gnueabi-gcc GOARCH=arm GOARM=5 go build -tags "${{ env.GOTAGS }}" | ||
- run: CC=arm-linux-gnueabihf-gcc GOARCH=arm GOARM=6 go build -tags "${{ env.GOTAGS }}" | ||
- run: CC=aarch64-linux-gnu-gcc GOARCH=arm64 go build -tags "${{ env.GOTAGS }}" | ||
|
||
# This is job is required for branch protection as a required gihub check | ||
# because GitHub actions show up as checks at the job level and not the | ||
# workflow level. This is currently a feature request: | ||
# https://github.com/orgs/community/discussions/12395 | ||
# | ||
# This job must: | ||
# - be placed after the fanout of a workflow so that everything fans back in | ||
# to this job. | ||
# - "need" any job that is part of the fan out / fan in | ||
# - implement the if logic because we have conditional jobs | ||
# (go-test-enteprise) that this job needs and this would potentially get | ||
# skipped if a previous job got skipped. So we use the if clause to make | ||
# sure it does not get skipped. | ||
|
||
build-distros-success: | ||
needs: | ||
- setup | ||
- check-go-mod | ||
- build-386 | ||
- build-amd64 | ||
- build-arm | ||
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }} | ||
if: | | ||
(always() && ! cancelled()) && | ||
!contains(needs.*.result, 'failure') && | ||
!contains(needs.*.result, 'cancelled') | ||
steps: | ||
- run: echo "build-distros succeeded" |
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
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
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
Oops, something went wrong.