add github action script

This commit is contained in:
jangko 2021-01-07 12:18:00 +07:00
commit 9f7f5ac370
No known key found for this signature in database
GPG key ID: 31702AE10541E6B9
3 changed files with 200 additions and 4 deletions

View file

@ -12,8 +12,17 @@ requires "nim >= 1.2.0",
"testutils",
"chronos"
task test, "Run all tests":
exec "nim c -r -d:debug --threads:on tests/all_tests"
exec "nim c -r -d:release --threads:on tests/all_tests"
exec "nim c -r -d:danger --threads:on tests/all_tests"
### Helper functions
proc test(env, path: string) =
# Compilation language is controlled by TEST_LANG
var lang = "c"
if existsEnv"TEST_LANG":
lang = getEnv"TEST_LANG"
exec "nim " & lang & " " & env &
" -r --hints:off --warnings:off " & path
task test, "Run all tests":
test "-d:debug --threads:on", "tests/all_tests"
test "-d:release --threads:on", "tests/all_tests"
test "-d:danger --threads:on", "tests/all_tests"