-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2888 from lucas-clemente/cross-compile-test
cross compile quic-go for all platforms / architectures
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 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,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
GOVERSION=$(go version | cut -d " " -f 3 | cut -b 3-6) | ||
|
||
for dist in $(go tool dist list); do | ||
goos=$(echo $dist | cut -d "/" -f1) | ||
goarch=$(echo $dist | cut -d "/" -f2) | ||
if [[ "$goos" == "android" ]]; then continue; fi # cross-compiling for android is a pain... | ||
if [[ "$goos" == "darwin" && $goarch == "arm64" ]]; then continue; fi # ... darwin/arm64 neither | ||
if [[ $GOVERSION == "1.14" && $goos == "darwin" && $goarch == "arm" ]]; then continue; fi # Go 1.14 lacks syscall.IPV6_RECVTCLASS | ||
|
||
echo "$dist" | ||
GOOS=$goos GOARCH=$goarch go build -o main example/main.go | ||
rm main | ||
done |
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,19 @@ | ||
on: [push, pull_request] | ||
jobs: | ||
crosscompile: | ||
strategy: | ||
matrix: | ||
go: [ "1.14.x", "1.15.x" ] | ||
runs-on: ubuntu-latest | ||
name: "Cross Compilation (Go ${{matrix.go}})" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Install build utils | ||
run: sudo apt-get install -y gcc-multilib | ||
- name: Install dependencies | ||
run: go build example/main.go | ||
- name: Run cross compilation | ||
run: .github/workflows/cross-compile.sh |