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

SparrowCI for multiple rakudos and Linux distors #1

Merged
merged 17 commits into from Nov 11, 2022
100 changes: 100 additions & 0 deletions sparrow.yaml
@@ -0,0 +1,100 @@
image:
- melezhik/sparrow:debian
- melezhik/sparrow:ubuntu
- melezhik/sparrow:archlinux
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
- 2022.07
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
zef build .

/usr/bin/time -o "${cache_root_dir}/${version}_time" \
zef test . && touch "${cache_root_dir}/${version}_ok"

depends:
-
name: install-deps
-
name: install-deps
language: Bash
code: |
if test $os = "alpine"; then
sudo apk add taglib-dev zlib-dev
elif test $os = "debian"; then
sudo apt-get install -y libtag1-dev zlib1g-dev time
elif test $os = "ubuntu"; then
sudo apt-get install -y libtag1-dev zlib1g-dev time
elif test $os = "arch"; then
sudo pacman -S --needed --noconfirm -q taglib zlib time
fi
zef install --/test Text::Table::Simple