Test compilation of all arches

* Add compile_all step to Makefile
  * Add this to travis
  * Add -compile-only flag to cross-compile.go to save time making the zips
This commit is contained in:
Nick Craig-Wood 2017-08-04 23:20:26 +01:00
parent 92d2e1f8d7
commit ee6a35d750
3 changed files with 33 additions and 22 deletions

View File

@ -15,6 +15,7 @@ install:
script:
- make check
- make quicktest
- make compile_all
env:
global:
- GOTAGS=cmount

View File

@ -123,6 +123,13 @@ upload_beta:
rclone --config bin/travis.rclone.conf -v copy --include '*beta-latest*' build/ memstore:beta-rclone-org
@echo Beta release ready at $(BETA_URL)
compile_all:
ifdef GO_LATEST
go run bin/cross-compile.go -parallel 8 -compile-only $(BUILDTAGS) $(TAG)β
else
@echo Skipping compile all as not on Go stable
endif
travis_beta:
git log $(LAST_TAG).. > /tmp/git-log.txt
go run bin/cross-compile.go -release beta-latest -git-log /tmp/git-log.txt -exclude "^windows/" -parallel 8 $(BUILDTAGS) $(TAG)β

View File

@ -28,6 +28,7 @@ var (
cgo = flag.Bool("cgo", false, "Use cgo for the build")
noClean = flag.Bool("no-clean", false, "Don't clean the build directory before running.")
tags = flag.String("tags", "", "Space separated list of build tags")
compileOnly = flag.Bool("compile-only", false, "Just build the binary, not the zip.")
)
// GOOS/GOARCH pairs we build for
@ -117,6 +118,7 @@ func compileArch(version, goos, goarch, dir string) {
env = append(env, flags...)
}
runEnv(args, env)
if !*compileOnly {
// Now build the zip
run("cp", "-a", "../MANUAL.txt", filepath.Join(dir, "README.txt"))
run("cp", "-a", "../MANUAL.html", filepath.Join(dir, "README.html"))
@ -131,6 +133,7 @@ func compileArch(version, goos, goarch, dir string) {
run("ln", zip, copyAsZip)
}
run("rm", "-rf", dir)
}
log.Printf("Done compiling %s/%s", goos, goarch)
}