-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: split cross-build check into separate workflow
- Loading branch information
1 parent
131aa7c
commit 46f2e4b
Showing
2 changed files
with
53 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Cross-Build Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
cross-build-test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
goos: ['android', 'linux', 'solaris', 'illumos', 'dragonfly', 'freebsd', 'openbsd', 'plan9', 'windows', 'darwin', 'netbsd'] | ||
go-version: [ 1.14.x ] | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- 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 | ||
echo "::set-output name=go_cache::$(go env GOCACHE)" | ||
- name: Cache the build cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.vars.outputs.go_cache }} | ||
key: cross-build-go-${{ runner.goos }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
cross-build-go-${{ runner.goos }} | ||
- name: Checkout code into the Go module directory | ||
uses: actions/checkout@v2 | ||
- name: Run Build | ||
env: | ||
CGO_ENABLED: 0 | ||
GOOS: ${{ runner.goos }} | ||
shell: bash | ||
working-directory: ./cmd/caddy | ||
run: | | ||
echo "GOOS is: ${GOOS}" | ||
GOOS=$GOOS go build -trimpath -o caddy-"$GOOS"-amd64 |