2020-08-01 15:23:22 -05:00
|
|
|
name: Cross-Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-05-11 23:26:16 -05:00
|
|
|
- 2.*
|
2020-08-01 15:23:22 -05:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-05-11 23:26:16 -05:00
|
|
|
- 2.*
|
2020-08-01 15:23:22 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
cross-build-test:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-07-21 23:00:48 -05:00
|
|
|
goos:
|
2023-12-11 07:55:04 -05:00
|
|
|
- 'aix'
|
2023-07-21 23:00:48 -05:00
|
|
|
- 'android'
|
|
|
|
- 'linux'
|
|
|
|
- 'solaris'
|
|
|
|
- 'illumos'
|
|
|
|
- 'dragonfly'
|
|
|
|
- 'freebsd'
|
|
|
|
- 'openbsd'
|
|
|
|
- 'plan9'
|
|
|
|
- 'windows'
|
|
|
|
- 'darwin'
|
|
|
|
- 'netbsd'
|
|
|
|
go:
|
2023-08-09 11:34:28 -05:00
|
|
|
- '1.21'
|
2022-04-13 15:03:38 -05:00
|
|
|
|
|
|
|
include:
|
|
|
|
# Set the minimum Go patch version for the given Go minor
|
|
|
|
# Usable via ${{ matrix.GO_SEMVER }}
|
2023-08-09 11:34:28 -05:00
|
|
|
- go: '1.21'
|
|
|
|
GO_SEMVER: '~1.21.0'
|
2022-04-13 15:03:38 -05:00
|
|
|
|
2020-08-01 15:23:22 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
2023-04-14 20:38:33 -05:00
|
|
|
- name: Checkout code
|
2023-10-01 19:13:54 -05:00
|
|
|
uses: actions/checkout@v4
|
2023-04-14 20:38:33 -05:00
|
|
|
|
2020-08-01 15:23:22 -05:00
|
|
|
- name: Install Go
|
2023-04-01 23:36:16 -05:00
|
|
|
uses: actions/setup-go@v4
|
2020-08-01 15:23:22 -05:00
|
|
|
with:
|
2022-04-13 15:03:38 -05:00
|
|
|
go-version: ${{ matrix.GO_SEMVER }}
|
|
|
|
check-latest: true
|
2020-08-20 21:40:26 -05:00
|
|
|
|
2020-08-01 15:23:22 -05:00
|
|
|
- name: Print Go version and environment
|
|
|
|
id: vars
|
|
|
|
run: |
|
|
|
|
printf "Using go at: $(which go)\n"
|
|
|
|
printf "Go version: $(go version)\n"
|
|
|
|
printf "\n\nGo environment:\n\n"
|
|
|
|
go env
|
|
|
|
printf "\n\nSystem environment:\n\n"
|
|
|
|
env
|
2020-08-20 21:40:26 -05:00
|
|
|
|
2020-08-01 15:23:22 -05:00
|
|
|
- name: Run Build
|
|
|
|
env:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
GOOS: ${{ matrix.goos }}
|
2023-12-11 07:55:04 -05:00
|
|
|
GOARCH: ${{ matrix.goos == 'aix' && 'ppc64' || 'amd64' }}
|
2020-08-01 15:23:22 -05:00
|
|
|
shell: bash
|
|
|
|
continue-on-error: true
|
|
|
|
working-directory: ./cmd/caddy
|
|
|
|
run: |
|
2023-12-11 07:55:04 -05:00
|
|
|
GOOS=$GOOS GOARCH=$GOARCH go build -trimpath -o caddy-"$GOOS"-$GOARCH 2> /dev/null
|
2020-08-01 15:23:22 -05:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "::warning ::$GOOS Build Failed"
|
|
|
|
exit 0
|
|
|
|
fi
|