2021-08-29 11:12:30 +08:00
|
|
|
name: "go: test building cross-platform binary"
|
2021-08-28 09:53:24 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
workflow_dispatch: []
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
goos: [linux, windows, darwin, freebsd, netbsd, openbsd]
|
2021-08-28 10:23:20 +08:00
|
|
|
goarch: [amd64, arm, arm64, 386]
|
2021-08-28 09:53:24 +08:00
|
|
|
exclude:
|
|
|
|
- goarch: arm
|
|
|
|
goos: darwin
|
|
|
|
- goarch: 386
|
|
|
|
goos: darwin
|
|
|
|
- goarch: arm
|
|
|
|
goos: windows
|
|
|
|
- goarch: arm64
|
|
|
|
goos: windows
|
|
|
|
|
2021-08-28 10:10:15 +08:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.head_ref }}/binary_test/${{ matrix.goos }}/${{ matrix.goarch }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-08-28 09:53:24 +08:00
|
|
|
steps:
|
|
|
|
|
2021-08-28 10:17:03 +08:00
|
|
|
- name: Set up Go 1.x
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ^1.13
|
|
|
|
id: go
|
|
|
|
|
2021-08-28 09:53:24 +08:00
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2021-08-28 10:17:03 +08:00
|
|
|
- name: Get dependencies
|
|
|
|
run: |
|
|
|
|
cd weed; go get -v -t -d ./...
|
|
|
|
if [ -f Gopkg.toml ]; then
|
|
|
|
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
|
|
dep ensure
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: cd weed; GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -v .
|