From e019590840bc3c4aa45521dda4b63f509e84d1fe Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Mon, 29 Jul 2024 15:42:42 +0200 Subject: [PATCH] CI check for 0.0.24 release --- .github/workflows/linux.yml | 26 +++++++++ .github/workflows/macos.yml | 26 +++++++++ .github/workflows/{test.yml => windows.yml} | 10 ++-- Changes | 2 + README.md | 4 +- dist.ini | 4 +- run-tests | 58 ++++++++++++--------- 7 files changed, 97 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/macos.yml rename .github/workflows/{test.yml => windows.yml} (70%) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..ab53183 --- /dev/null +++ b/.github/workflows/linux.yml @@ -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 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..de79738 --- /dev/null +++ b/.github/workflows/macos.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/windows.yml similarity index 70% rename from .github/workflows/test.yml rename to .github/workflows/windows.yml index 8b34ff7..557c8d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: test +name: Windows on: push: @@ -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 diff --git a/Changes b/Changes index 5cee466..54aad0c 100644 --- a/Changes +++ b/Changes @@ -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" diff --git a/README.md b/README.md index 8660552..b8c6b85 100644 --- a/README.md +++ b/README.md @@ -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 ==== @@ -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 diff --git a/dist.ini b/dist.ini index 2f0cbc0..a58275d 100644 --- a/dist.ini +++ b/dist.ini @@ -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 diff --git a/run-tests b/run-tests index 0528988..7ac0c9c 100644 --- a/run-tests +++ b/run-tests @@ -1,4 +1,4 @@ -unit sub MAIN(:$author); +unit sub MAIN(:a($author), :i($install)); say run(, :out).out.slurp.chomp; say "Running on $*DISTRO.gist().\n"; @@ -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:";