From 2d0d5e6e83f83c6c1e9c954cab6735b1d9f0b3c5 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Sat, 31 Aug 2024 20:20:52 +0200 Subject: [PATCH] CI test for 0.4.12 release --- .github/workflows/FUNDING.yml | 1 + .github/workflows/linux.yml | 28 ++++++++++++++ .github/workflows/{test.yml => macos.yml} | 12 +++--- .github/workflows/windows.yml | 28 ++++++++++++++ Changes | 4 ++ META6.json | 2 +- README.md | 4 +- dist.ini | 4 +- lib/IRC/Client.rakumod | 4 +- run-tests | 46 +++++++++++++++++------ 10 files changed, 108 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/FUNDING.yml create mode 100644 .github/workflows/linux.yml rename .github/workflows/{test.yml => macos.yml} (71%) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/FUNDING.yml b/.github/workflows/FUNDING.yml new file mode 100644 index 0000000..8353266 --- /dev/null +++ b/.github/workflows/FUNDING.yml @@ -0,0 +1 @@ +lizmat: 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/test.yml b/.github/workflows/macos.yml similarity index 71% rename from .github/workflows/test.yml rename to .github/workflows/macos.yml index 2927799..f4fcd71 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/macos.yml @@ -1,4 +1,4 @@ -name: test +name: MacOS on: push: @@ -13,20 +13,18 @@ jobs: strategy: matrix: os: - - ubuntu-latest - - macOS-latest - - windows-latest + - macos-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 }} - - if: matrix.os == 'macOS-latest' + - name: Install OpenSSL run: brew install openssl - name: Install Dependencies run: zef -v install --/test --test-depends --deps-only . - name: Run Tests - run: raku run-tests + run: raku run-tests -i diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..721ccba --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,28 @@ +name: Windows + +on: + push: + branches: + - '*' + tags-ignore: + - '*' + pull_request: + +jobs: + raku: + strategy: + matrix: + os: + - windows-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/Changes b/Changes index 906e51b..17f0b3c 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,10 @@ Revision history for IRC::Client {{$NEXT}} + - Bump version of IO::Socket::Async::SSL, and make it accept any + future versions as well, to prevent clashes with e.g. Whateverable + - Add separate badges for each OS + - Update copyright year 4.0.11 2023-11-07T14:12:36+01:00 - Don't cue ping tests for the same second. This could happen when diff --git a/META6.json b/META6.json index a1f3736..634a26d 100644 --- a/META6.json +++ b/META6.json @@ -7,7 +7,7 @@ "build-depends": [ ], "depends": [ - "IO::Socket::Async::SSL:ver<0.7.14>" + "IO::Socket::Async::SSL:ver<0.8.0+>" ], "description": "Extendable Internet Relay Chat client", "license": "Artistic-2.0", diff --git a/README.md b/README.md index 68ee6c3..97d928e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Actions Status](https://github.com/lizmat/IRC-Client/workflows/test/badge.svg)](https://github.com/lizmat/IRC-Client/actions) +[![Actions Status](https://github.com/lizmat/IRC-Client/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/IRC-Client/actions) [![Actions Status](https://github.com/lizmat/IRC-Client/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/IRC-Client/actions) [![Actions Status](https://github.com/lizmat/IRC-Client/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/IRC-Client/actions) NAME ==== @@ -58,7 +58,7 @@ COPYRIGHT AND LICENSE Copyright 2015-2021 Zoffix Znet -Copyright 2021-2023 Elizabeth Mattijsen +Copyright 2021-2024 Elizabeth Mattijsen If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me! diff --git a/dist.ini b/dist.ini index eae276c..b0a6fea 100644 --- a/dist.ini +++ b/dist.ini @@ -8,6 +8,8 @@ filename = lib/IRC/Client.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/IRC/Client.rakumod b/lib/IRC/Client.rakumod index fed5177..64189e6 100644 --- a/lib/IRC/Client.rakumod +++ b/lib/IRC/Client.rakumod @@ -1,4 +1,4 @@ -use IO::Socket::Async::SSL:ver<0.7.14>; +use IO::Socket::Async::SSL:ver<0.8.0+>; unit class IRC::Client; my &colored; # debug message coloring logic @@ -866,7 +866,7 @@ Pull Requests are welcome. Copyright 2015-2021 Zoffix Znet -Copyright 2021-2023 Elizabeth Mattijsen +Copyright 2021-2024 Elizabeth Mattijsen If you like this module, or what I’m doing more generally, committing to a L would mean a great diff --git a/run-tests b/run-tests index 6cc9c46..a833103 100644 --- a/run-tests +++ b/run-tests @@ -1,39 +1,61 @@ +unit sub MAIN(:a($author), :i($install)); + say run(, :out).out.slurp.chomp; say "Running on $*DISTRO.gist().\n"; -say "Testing {"dist.ini".IO.lines.head.substr(7)}"; +say "Testing { + "dist.ini".IO.lines.head.substr(7) +}{ + " including author tests" if $author +}"; my @failed; my $done = 0; -for "t".IO.dir(:test(*.ends-with: '.t' | '.rakutest')).map(*.Str).sort { - say "=== $_"; - my $proc = run "raku", "--ll-exception", "-Ilib", $_, :out, :err, :merge; + +sub process($proc, $filename) { if $proc { $proc.out.slurp; } else { - @failed.push($_); + @failed.push($filename); if $proc.out.slurp -> $stdout { my @lines = $stdout.lines; - with @lines.first(*.starts-with(" from gen/moar/stage2"),:k) -> $index { + 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; - } else { - say "No output received, exit-code $proc.exitcode() ($proc.signal())"; + say "No output received, exit-code $proc.exitcode() ($proc.signal()):\n$proc.os-error()"; } } - $done++; } +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 && "xt".IO.e; +install if $install; + if @failed { - say "FAILED: {+@failed} of $done:"; + say "\nFAILED: {+@failed} of $done:"; say " $_" for @failed; exit +@failed; }