diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..7341150 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,28 @@ +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: Install Dependencies + run: zef install --/test --test-depends --deps-only . + - 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..14c595d --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,28 @@ +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: Install Dependencies + run: zef install --/test --test-depends --deps-only . + - name: Run Special Tests + run: raku run-tests -i diff --git a/.github/workflows/test.yml b/.github/workflows/windows.yml similarity index 64% rename from .github/workflows/test.yml rename to .github/workflows/windows.yml index 8e5a019..721ccba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: test +name: Windows on: push: @@ -13,18 +13,16 @@ 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: Install Dependencies - run: zef -v install --/test --test-depends --deps-only . - - name: Run Tests - run: raku run-tests + run: zef install --/test --test-depends --deps-only . + - name: Run Special Tests + run: raku run-tests -i diff --git a/Changes b/Changes index 0b30400..ed2b5ea 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,12 @@ Revision history for uniname-words {{$NEXT}} +10.0.14 2024-08-10T13:51:34+02:00 + - Up dependency on Map::Match + - Add sponsor button + - Add separate CI badges for each OS + - Update copyright year + 10.0.13 2023-12-19T11:21:02+01:00 - Up dependency on Map::Match - Update copyright year diff --git a/META6.json b/META6.json index 111bd42..303d41c 100644 --- a/META6.json +++ b/META6.json @@ -6,7 +6,7 @@ "build-depends": [ ], "depends": [ - "Map::Match:ver<0.0.4>:auth" + "Map::Match:ver<0.0.5>:auth" ], "description": "look for words in unicode character names", "license": "Artistic-2.0", @@ -23,5 +23,5 @@ ], "test-depends": [ ], - "version": "10.0.13" + "version": "10.0.14" } diff --git a/README.md b/README.md index f63ae06..ba014e8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Actions Status](https://github.com/lizmat/uniname-words/workflows/test/badge.svg)](https://github.com/lizmat/uniname-words/actions) +[![Actions Status](https://github.com/lizmat/uniname-words/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/uniname-words/actions) [![Actions Status](https://github.com/lizmat/uniname-words/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/uniname-words/actions) [![Actions Status](https://github.com/lizmat/uniname-words/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/uniname-words/actions) NAME ==== @@ -59,7 +59,7 @@ If you like this module, or what I’m doing more generally, committing to a [sm COPYRIGHT AND LICENSE ===================== -Copyright 2021, 2022, 2023 Elizabeth Mattijsen +Copyright 2021, 2022, 2023, 2024 Elizabeth Mattijsen This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0. diff --git a/dist.ini b/dist.ini index 371ac62..991e9f3 100644 --- a/dist.ini +++ b/dist.ini @@ -8,6 +8,8 @@ filename = lib/uniname-words.rakumod ; match = ^ 'xt/' [Badges] -provider = github-actions/test +provider = github-actions/linux.yml +provider = github-actions/macos.yml +provider = github-actions/windows.yml [UploadToZef] diff --git a/lib/uniname-words.rakumod b/lib/uniname-words.rakumod index c6ff36b..db44084 100644 --- a/lib/uniname-words.rakumod +++ b/lib/uniname-words.rakumod @@ -114,7 +114,7 @@ my $match; my multi sub uniname-words(Regex:D $regex) { without $match { use nqp; - use Map::Match:ver<0.0.4>:auth; + use Map::Match:ver<0.0.5>:auth; $match := nqp::create(Map::Match); nqp::bindattr($match,Map::Match,'%!map',%uniname-words); nqp::bindattr($match,Map::Match,'$!keys',nqp::decont($words)); @@ -211,7 +211,7 @@ deal to me! =head1 COPYRIGHT AND LICENSE -Copyright 2021, 2022, 2023 Elizabeth Mattijsen +Copyright 2021, 2022, 2023, 2024 Elizabeth Mattijsen This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0. diff --git a/run-tests b/run-tests index 0528988..a833103 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,42 +12,50 @@ 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, $filename) { + if $proc { + $proc.out.slurp; + } + else { + @failed.push($filename); + 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, "*installation*"); +} + +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:"; + say "\nFAILED: {+@failed} of $done:"; say " $_" for @failed; exit +@failed; }