Skip to content

Commit

Permalink
CI check for 0.0.24 release
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jul 29, 2024
1 parent 4d801e6 commit e019590
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 33 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Linux

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- ubuntu-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Run Special Tests
run: raku run-tests -i
26 changes: 26 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: MacOS

on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:

jobs:
raku:
strategy:
matrix:
os:
- macos-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Run Special Tests
run: raku run-tests -i
10 changes: 4 additions & 6 deletions .github/workflows/test.yml → .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test
name: Windows

on:
push:
Expand All @@ -13,16 +13,14 @@ jobs:
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
raku-version:
- 'latest'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Run Tests
run: raku run-tests
- name: Run Special Tests
run: raku run-tests -i
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Revision history for String-Utils

{{$NEXT}}
- Add separate CI badges for each OS
- Add sponsor button

0.0.23 2024-05-13T12:59:15+02:00
- Add support for "nomark"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Actions Status](https://github.com/lizmat/String-Utils/workflows/test/badge.svg)](https://github.com/lizmat/String-Utils/actions)
[![Actions Status](https://github.com/lizmat/String-Utils/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/String-Utils/actions) [![Actions Status](https://github.com/lizmat/String-Utils/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/String-Utils/actions) [![Actions Status](https://github.com/lizmat/String-Utils/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/String-Utils/actions)

NAME
====
Expand Down Expand Up @@ -39,6 +39,8 @@ say non-word "foo/bar"; # True

say letters("//foo:bar"); # foobar

say nomark("élève"); # eleve

say has-marks("foo👩🏽‍💻bar"); # False
say has-marks("fóöbar"); # True

Expand Down
4 changes: 3 additions & 1 deletion dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ filename = lib/String/Utils.rakumod
; match = ^ 'xt/'

[Badges]
provider = github-actions/test
provider = github-actions/linux.yml
provider = github-actions/macos.yml
provider = github-actions/windows.yml
58 changes: 33 additions & 25 deletions run-tests
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unit sub MAIN(:$author);
unit sub MAIN(:a($author), :i($install));

say run(<raku --version>, :out).out.slurp.chomp;
say "Running on $*DISTRO.gist().\n";
Expand All @@ -12,39 +12,47 @@ say "Testing {
my @failed;
my $done = 0;

sub test-dir($dir) {
for $dir.IO.dir(:test(*.ends-with: '.t' | '.rakutest')).map(*.Str).sort {
say "=== $_";
my $proc := run "raku", "--ll-exception", "-I.", $_, :out,:err,:merge;
if $proc {
$proc.out.slurp;
}
else {
@failed.push($_);
if $proc.out.slurp -> $stdout {
my @lines = $stdout.lines;
with @lines.first(
*.starts-with(" from gen/moar/stage2"),:k)
-> $index {
say @lines[^$index].join("\n");
}
else {
say $stdout;
}
}
elsif $proc.err -> $stderr {
say .slurp with $stderr;
sub process($proc) {
if $proc {
$proc.out.slurp;
}
else {
@failed.push($_);
if $proc.out.slurp -> $stdout {
my @lines = $stdout.lines;
with @lines.first(
*.starts-with(" from gen/moar/stage2"),:k)
-> $index {
say @lines[^$index].join("\n");
}
else {
say "No output received, exit-code $proc.exitcode() ($proc.signal())";
say $stdout;
}
}
else {
say "No output received, exit-code $proc.exitcode() ($proc.signal()):\n$proc.os-error()";
}
}
}

sub install() {
my $zef := $*DISTRO.is-win ?? 'zef.bat' !! 'zef';
my $proc := run $zef, "install", ".", "--verbose", "--/test", :out,:err,:merge;
process($proc);
}

sub test-dir($dir) {
for $dir.IO.dir(:test(*.ends-with: '.t' | '.rakutest')).map(*.Str).sort {
say "=== $_";
my $proc := run "raku", "--ll-exception", "-I.", $_, :out,:err,:merge;
process($proc);
$done++;
}
}

test-dir("t");
test-dir("xt") if $author;
test-dir("xt") if $author && "xt".IO.e;
install if $install;

if @failed {
say "FAILED: {+@failed} of $done:";
Expand Down

0 comments on commit e019590

Please sign in to comment.