forked from quic-go/quic-go
ci: fix ordering of error output of the cross compilation workflow (#3809)
This commit is contained in:
19
.github/workflows/cross-compile.sh
vendored
19
.github/workflows/cross-compile.sh
vendored
@@ -12,7 +12,22 @@ if [[ "$goos" == "android" ]]; then exit; fi
|
|||||||
# Cgo would then need a C cross compilation setup. Not worth the hassle.
|
# Cgo would then need a C cross compilation setup. Not worth the hassle.
|
||||||
if [[ "$goos" == "ios" ]]; then exit; fi
|
if [[ "$goos" == "ios" ]]; then exit; fi
|
||||||
|
|
||||||
echo "$dist"
|
# Write all log output to a temporary file instead of to stdout.
|
||||||
|
# That allows running this script in parallel, while preserving the correct order of the output.
|
||||||
|
log_file=$(mktemp)
|
||||||
|
|
||||||
|
error_handler() {
|
||||||
|
cat "$log_file" >&2
|
||||||
|
rm "$log_file"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
trap 'error_handler' ERR
|
||||||
|
|
||||||
|
echo "$dist" >> "$log_file"
|
||||||
out="main-$goos-$goarch"
|
out="main-$goos-$goarch"
|
||||||
GOOS=$goos GOARCH=$goarch go build -o $out example/main.go
|
GOOS=$goos GOARCH=$goarch go build -o $out example/main.go >> "$log_file" 2>&1
|
||||||
rm $out
|
rm $out
|
||||||
|
|
||||||
|
cat "$log_file"
|
||||||
|
rm "$log_file"
|
||||||
|
|||||||
Reference in New Issue
Block a user