Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create sparrow.yaml #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions sparrow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
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.06
- 2023.06
- 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
rakubrew download moar-$version
rakubrew switch moar-$version
cd source/
zef install --/test --deps-only --to=home .
/usr/bin/time -f "%E real,%U user,%S sys" -o "${cache_root_dir}/${version}_time" \
zef test . && touch "${cache_root_dir}/${version}_ok"
depends:
-
name: rakubrew-install
-
name: rakubrew-install
language: Bash
code: |
set -e
curl -sf https://rakubrew.org/perl/rakubrew -o rakubrew
sudo mv rakubrew /usr/local/bin
sudo chmod a+x /usr/local/bin/rakubrew
rakubrew mode shim
zef install --/test Text::Table::Simple
sudo apk add time --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/