From 89a15e417df52454aa5c40ba058c9b19425dd184 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Tue, 30 Jun 2020 05:21:30 -0700 Subject: CI openbsd: 3x batching via NIM_TESTAMENT_BATCH ; overall CI finishes in 21m instead of 34m (#14851) * CI openbsd: 2x batching via NIM_TESTAMENT_BATCH * auto-generate .builds/openbsd_x.yml to avoid code duplication * 3x batching --- tools/ci_generate.nim | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 tools/ci_generate.nim (limited to 'tools') diff --git a/tools/ci_generate.nim b/tools/ci_generate.nim new file mode 100644 index 000000000..bfed8d88f --- /dev/null +++ b/tools/ci_generate.nim @@ -0,0 +1,63 @@ +##[ +avoid code duplication in CI pipelines. +For now, this is only used for openbsd, but there is a lot of other code +duplication that could be removed. + +## usage +edit this file as needed and then re-generate via: +``` +nim r tools/ci_generate.nim +``` +]## + +import std/strformat + +proc genCIopenbsd(batch: int, num: int): string = + result = fmt""" +## do not edit directly; auto-generated by `nim r tools/ci_generate.nim` + +image: openbsd/latest +packages: +- gmake +- sqlite3 +- node +- boehm-gc +- pcre +- sfml +- sdl2 +- libffi +sources: +- https://github.com/nim-lang/Nim +environment: + NIM_TESTAMENT_BATCH: "{batch}_{num}" + CC: /usr/bin/clang +tasks: +- setup: | + cd Nim + git clone --depth 1 -q https://github.com/nim-lang/csources.git + gmake -C csources -j $(sysctl -n hw.ncpuonline) + bin/nim c koch + echo 'export PATH=$HOME/Nim/bin:$PATH' >> $HOME/.buildenv +- test: | + cd Nim + if ! ./koch runCI; then + nim c -r tools/ci_testresults.nim + exit 1 + fi +triggers: +- action: email + condition: failure + to: Andreas Rumpf +""" + +proc main()= + let num = 3 + # if you reduce this, make sure to remove files that shouldn't be generated, + # or better, do the cleanup logic here eg: `rm .builds/openbsd_*` + for i in 0..