-
Notifications
You must be signed in to change notification settings - Fork 3
/
sparrow.yaml
83 lines (81 loc) · 2.35 KB
/
sparrow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
image:
- melezhik/sparrow:debian
tasks:
-
name: main
default: true
language: Raku
code: |
use Text::Table::Simple;
my @columns = ("Rakudo Version", "Status", "Time", "Linux Dist");
my @rows;
my $fail = False;
for config()<tasks><multi-versions><state><list><> -> $i {
@rows.push: [ $i<version>, $i<status>, $i<time>, os() ];
$fail = True unless $i<status> eq "OK";
}
my @table = lol2table(@columns,@rows);
.say for @table;
die "some tests failed" if $fail == True;
depends:
-
name: multi-versions
-
name: multi-versions
language: Raku
config:
list:
# - 2022.04
- 2022.07
- 2022.12
code: |
my @state;
for config()<list><> -> $v {
my $s = %( version => $v );
if "{cache_root_dir()}/{$v}_ok".IO ~~ :e {
$s<status> = "OK";
} else {
$s<status> = "FAIL";
}
if "{cache_root_dir()}/{$v}_time".IO ~~ :e {
$s<time> = "{cache_root_dir()}/{$v}_time".IO.slurp();
} else {
$s<time> = "NA";
}
@state.push: $s;
}
update_state %( list => @state );
init: |
for config()<list><> -> $v {
run_task("test", %( version => $v ));
}
subtasks:
-
name: test
language: Bash
init: |
ignore_error
code: |
set -e
echo "Linux version: $os"
curl -sL https://rakudo.org/dl/rakudo/rakudo-moar-$version-01-linux-x86_64-gcc.tar.gz \
-o rakudo-moar-$version-01-linux-x86_64-gcc.tar.gz
tar -xzf rakudo-moar-$version-01-linux-x86_64-gcc.tar.gz
eval "$(rakudo-moar-$version-01-linux-x86_64-gcc/scripts/set-env.sh)"
which raku
which zef
raku --version
zef --version
cd source/
zef install . --deps-only --test-depends --build-depends --/test -to=home
/usr/bin/time -f "%E real,%U user,%S sys | CPU Percentage: %P" -o "${cache_root_dir}/${version}_time" \
zef test --debug . && touch "${cache_root_dir}/${version}_ok"
depends:
-
name: install-deps
-
name: install-deps
language: Bash
code: |
sudo apt-get install -y time
zef install --/test Text::Table::Simple