From 1bfb525ce138bd9593ce69b2b715ab3d560ca7a4 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 15 Aug 2021 09:03:14 +0300 Subject: [PATCH] tools/fast: improve uploading to gh pages and print errors --- cmd/tools/fast/fast.v | 14 ++++++++++++-- cmd/tools/fast/fast_job.v | 8 +------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cmd/tools/fast/fast.v b/cmd/tools/fast/fast.v index 0b9f05a531..6a91855421 100644 --- a/cmd/tools/fast/fast.v +++ b/cmd/tools/fast/fast.v @@ -47,9 +47,12 @@ fn main() { // exec('git checkout $commit') println(' Building vprod...') os.chdir(vdir) - exec('./v -o vprod -prod -prealloc cmd/v') + if os.args.contains('-noprod') { + exec('./v -o vprod cmd/v') // for faster debugging + } else { + exec('./v -o vprod -prod -prealloc cmd/v') + } // println('cur vdir="$vdir"') - // exec('v -o vprod cmd/v') // for faster debugging // cache vlib modules exec('$vdir/v wipe-cache') exec('$vdir/v -o v2 -prod cmd/v') @@ -105,6 +108,13 @@ fn main() { //} // exec('git checkout master') // os.write_file('last_commit.txt', commits[commits.len - 1]) ? + // Upload the result to github pages + os.chdir('website') + os.execute_or_exit('git checkout gh-pages') + os.cp('../index.html', 'index.html') ? + os.system('git commit -am "update benchmark"') + os.system('git push origin gh-pages') + os.chdir('..') } fn exec(s string) string { diff --git a/cmd/tools/fast/fast_job.v b/cmd/tools/fast/fast_job.v index d4d8fc399e..c74e9cb1f2 100644 --- a/cmd/tools/fast/fast_job.v +++ b/cmd/tools/fast/fast_job.v @@ -30,13 +30,7 @@ fn main() { } if resp.exit_code != 0 { println('resp != 0, skipping') - } else { - os.chdir('website') - os.execute_or_exit('git checkout gh-pages') - os.cp('../index.html', 'index.html') ? - os.system('git commit -am "update benchmark"') - os.system('git push origin gh-pages') - os.chdir('..') + println(resp.output) } time.sleep(180 * time.second) }