From 131aa7c6f1b9eff5fe0c0730e6c626eb123a30ba Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Wed, 29 Jul 2020 03:04:39 +0300 Subject: [PATCH] ci: include tracking of GOOS for which Caddy fails to build --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67e15d4dce4..ec26b0059c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,6 +120,52 @@ jobs: # echo "step_test ${{ steps.step_test.outputs.status }}\n" # exit 1 + cross-build-check: + name: Cross-Build Check + runs-on: ubuntu-latest + continue-on-error: true + steps: + - 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-ci-${{ hashFiles('**/go.sum') }} + restore-keys: | + cross-build-go-ci + - name: Checkout code into the Go module directory + uses: actions/checkout@v2 + - name: Run Builds + env: + CGO_ENABLED: '0' + shell: bash + working-directory: ./cmd/caddy + run: | + + geese=('android' 'linux' 'solaris' 'illumos' 'dragonfly' 'freebsd' 'openbsd' 'plan9' 'windows' 'darwin' 'netbsd') + failed=() + for GOOS in "${geese[@]}"; do + echo "Building GOOS: $GOOS" + GOOS=$GOOS go build -trimpath -o caddy-"$GOOS"-amd64 || { + echo "Failed: $GOOS" + failed+=("$GOOS") + } + done + + if [ ${#failed[@]} -ne 0 ]; then + echo "The following geese failed: " "${failed[@]}" + exit 1 + fi + s390x-test: name: test (s390x on IBM Z) runs-on: ubuntu-latest