Skip to content

Commit 399eff4

Browse files
mohammed90francislavoiemholt
authored
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 <[email protected]> Co-authored-by: Francis Lavoie <[email protected]> Co-authored-by: Matt Holt <[email protected]>
1 parent c054a81 commit 399eff4

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Used as inspiration: https://github.com/mvdan/github-actions-golang
22

3-
name: Cross-Platform
3+
name: Tests
44

55
on:
66
push:

.github/workflows/cross-build.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Cross-Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
cross-build-test:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
goos: ['android', 'linux', 'solaris', 'illumos', 'dragonfly', 'freebsd', 'openbsd', 'plan9', 'windows', 'darwin', 'netbsd']
17+
go-version: [ 1.14.x ]
18+
runs-on: ubuntu-latest
19+
continue-on-error: true
20+
steps:
21+
- name: Install Go
22+
uses: actions/setup-go@v2
23+
with:
24+
go-version: ${{ matrix.go-version }}
25+
- name: Print Go version and environment
26+
id: vars
27+
run: |
28+
printf "Using go at: $(which go)\n"
29+
printf "Go version: $(go version)\n"
30+
printf "\n\nGo environment:\n\n"
31+
go env
32+
printf "\n\nSystem environment:\n\n"
33+
env
34+
echo "::set-output name=go_cache::$(go env GOCACHE)"
35+
- name: Cache the build cache
36+
uses: actions/cache@v1
37+
with:
38+
path: ${{ steps.vars.outputs.go_cache }}
39+
key: cross-build-go-${{ matrix.goos }}-${{ hashFiles('**/go.sum') }}
40+
restore-keys: |
41+
cross-build-go-${{ matrix.goos }}
42+
- name: Checkout code into the Go module directory
43+
uses: actions/checkout@v2
44+
- name: Run Build
45+
env:
46+
CGO_ENABLED: 0
47+
GOOS: ${{ matrix.goos }}
48+
shell: bash
49+
continue-on-error: true
50+
working-directory: ./cmd/caddy
51+
run: |
52+
GOOS=$GOOS go build -trimpath -o caddy-"$GOOS"-amd64 2> /dev/null
53+
if [ $? -ne 0 ]; then
54+
echo "::warning ::$GOOS Build Failed"
55+
exit 0
56+
fi

0 commit comments

Comments
 (0)