diff options
author | Mohammed Al Sahaf <msaa1990@gmail.com> | 2020-08-01 23:23:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-01 20:23:22 +0000 |
commit | 399eff415ca530c02b21506949526ca7fd0698fe (patch) | |
tree | 3f94504c6ece52f5fc0d6d655218c2f9cfe74f95 | |
parent | c054a818a1d6fee61cebc48b4286bb40d0553f4c (diff) |
ci: Include tracking of GOOS for which Caddy fails to build (#3617)
* ci: include tracking of GOOS for which Caddy fails to build
* ci: split cross-build check into separate workflow
* ci: cross-build check: make it clear the cross-build check is not a blocker
* ci: cross-build check: set annotation instead of failing the build
* ci: cross-build check: explicitly set continue-on-error to force success marker
* ci: cross-build check: send stderr to /dev/null
* ci: Simplify workflow names
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
-rw-r--r-- | .github/workflows/ci.yml | 2 | ||||
-rw-r--r-- | .github/workflows/cross-build.yml | 56 |
2 files changed, 57 insertions, 1 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67e15d4..8584455 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ # Used as inspiration: https://github.com/mvdan/github-actions-golang -name: Cross-Platform +name: Tests on: push: diff --git a/.github/workflows/cross-build.yml b/.github/workflows/cross-build.yml new file mode 100644 index 0000000..a935cba --- /dev/null +++ b/.github/workflows/cross-build.yml @@ -0,0 +1,56 @@ +name: Cross-Build + +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-${{ matrix.goos }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + cross-build-go-${{ matrix.goos }} + - name: Checkout code into the Go module directory + uses: actions/checkout@v2 + - name: Run Build + env: + CGO_ENABLED: 0 + GOOS: ${{ matrix.goos }} + shell: bash + continue-on-error: true + working-directory: ./cmd/caddy + run: | + GOOS=$GOOS go build -trimpath -o caddy-"$GOOS"-amd64 2> /dev/null + if [ $? -ne 0 ]; then + echo "::warning ::$GOOS Build Failed" + exit 0 + fi |