Fetch benchmark before checkout
This commit is contained in:
@@ -47,8 +47,11 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Printf("Done; Checking out benchmark branch")
|
||||
|
||||
log.Printf("Benchmarking done; Fetching benchmark branch")
|
||||
fetchBenchmark()
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
log.Printf("Checking out benchmark branch")
|
||||
checkoutBenchmark()
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
log.Printf("Adding benchmark results")
|
||||
@@ -72,8 +75,17 @@ func getHeadHash() string {
|
||||
return strings.TrimSpace(string(out))
|
||||
}
|
||||
|
||||
func fetchBenchmark() {
|
||||
gitFetch := exec.Command("git", "fetch", "origin", "benchmark")
|
||||
gitFetch.Dir = "../"
|
||||
out, err := gitFetch.CombinedOutput()
|
||||
if err != nil {
|
||||
log.Fatalf("Could not fetch benchmark branch with code %v and error %v", err, string(out))
|
||||
}
|
||||
}
|
||||
|
||||
func checkoutBenchmark() {
|
||||
gitCheckout := exec.Command("git", "checkout", "benchmark")
|
||||
gitCheckout := exec.Command("git", "checkout", "origin/benchmark")
|
||||
gitCheckout.Dir = "../"
|
||||
out, err := gitCheckout.CombinedOutput()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user