Skip to content

Commit

Permalink
CI test for update as Raku community module
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Nov 30, 2024
1 parent 44fd81c commit ccce16f
Show file tree
Hide file tree
Showing 11 changed files with 264 additions and 27 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Revision history for SOAP::Client

{{$NEXT}}
- Use modern file extensions
- Add CI badge for each OS
- Initial version with a Changes file
45 changes: 31 additions & 14 deletions META6.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
{
"raku" : "6.*",
"name" : "SOAP::Client",
"version" : "1.0.1",
"auth" : "zef:raku-community-modules",
"authors": ["Andrew Egeler", "Raku Community"],
"description" : "Quick and dirty SOAP client",
"depends" : ["XML", "LWP::Simple"],
"provides" : {
"SOAP::Client::WSDL" : "lib/SOAP/Client/WSDL.pm6",
"SOAP::Client" : "lib/SOAP/Client.pm6"
},
"source-url" : "https://github.com/raku-community-modules/SOAP"
}
{
"auth": "zef:raku-community-modules",
"authors": [
"Andrew Egeler",
"Raku Community"
],
"build-depends": [
],
"depends": [
"XML",
"LWP::Simple"
],
"description": "Quick and dirty SOAP client",
"license": "NOASSERTION",
"name": "SOAP::Client",
"provides": {
"SOAP::Client": "lib/SOAP/Client.rakumod",
"SOAP::Client::WSDL": "lib/SOAP/Client/WSDL.rakumod"
},
"raku": "6.*",
"resources": [
],
"source-url": "https://github.com/raku-community-modules/SOAP-Client.git",
"tags": [
"SOAP",
"CLIENT"
],
"test-depends": [
],
"version": "1.0.1"
}
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
# SOAP::Client
[![Actions Status](https://github.com/raku-community-modules/SOAP-Client/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/SOAP-Client/actions) [![Actions Status](https://github.com/raku-community-modules/SOAP-Client/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/SOAP-Client/actions) [![Actions Status](https://github.com/raku-community-modules/SOAP-Client/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/SOAP-Client/actions)

Raku library that acts as a SOAP client.
NAME
====

Warning: This library currently only supports the simplest of SOAP calls.
SOAP::Client - Quick and dirty SOAP client

## Synopsis
SYNOPSIS
========

```raku
use SOAP;
use SOAP::Client;

my $temp = SOAP::Client.new('https://www.w3schools.com/xml/tempconvert.asmx?WSDL');
say $temp.call('CelsiusToFahrenheit', Celsius => 100);
```

## Authors
DESCRIPTION
===========

Warning: This library currently only supports the simplest of SOAP calls.

AUTHOR
======

Initially by [Andrew Egeler `retupmoca`](https://github.com/retupmoca), currently managed by
the Raku community in the Raku modules adoption center
Andrew Egeler

# LICENSE
COPYRIGHT AND LICENSE
=====================

Copyright 2015- 2017 Andrew Egeler

Copyright 2018 - 2024 Raku Community

Licensed under the MIT license.

11 changes: 11 additions & 0 deletions dist.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name = SOAP::Client

[ReadmeFromPod]
filename = lib/SOAP/Client.rakumod

[UploadToZef]

[Badges]
provider = github-actions/linux.yml
provider = github-actions/macos.yml
provider = github-actions/windows.yml
37 changes: 37 additions & 0 deletions lib/SOAP/Client.pm6 → lib/SOAP/Client.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,40 @@ sub p6-to-xml($p6) {
}
return @ret;
}
=begin pod
=head1 NAME
SOAP::Client - Quick and dirty SOAP client
=head1 SYNOPSIS
=begin code :lang<raku>
use SOAP::Client;
my $temp = SOAP::Client.new('https://www.w3schools.com/xml/tempconvert.asmx?WSDL');
say $temp.call('CelsiusToFahrenheit', Celsius => 100);
=end code
=head1 DESCRIPTION
Warning: This library currently only supports the simplest of SOAP calls.
=head1 AUTHOR
Andrew Egeler
=head1 COPYRIGHT AND LICENSE
Copyright 2015- 2017 Andrew Egeler
Copyright 2018 - 2024 Raku Community
Licensed under the MIT license.
=end pod
# vim: expandtab shiftwidth=4
2 changes: 2 additions & 0 deletions lib/SOAP/Client/WSDL.pm6 → lib/SOAP/Client/WSDL.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,5 @@ method parse($xml) {
%!services{$name} = { :$documentation, :%ports };
}
}

# vim: expandtab shiftwidth=4
66 changes: 66 additions & 0 deletions run-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
unit sub MAIN(:a($author), :i($install));

say run(<raku --version>, :out).out.slurp.chomp;
say "Running on $*DISTRO.gist().\n";

say "Testing {
"dist.ini".IO.lines.head.substr(7)
}{
" including author tests" if $author
}";

my @failed;
my $done = 0;

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 $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($_) for dir("t", :test({ !.starts-with(".") && "t/$_".IO.d})).map(*.Str).sort;
test-dir("xt") if $author && "xt".IO.e;
install if $install;

if @failed {
say "\nFAILED: {+@failed} of $done:";
say " $_" for @failed;
exit +@failed;
}

say "\nALL {"$done " if $done > 1}OK";

# vim: expandtab shiftwidth=4
9 changes: 5 additions & 4 deletions t/05-simple-service.t → t/05-simple-service.rakutest
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use v6;
use Test;
plan 3;

use SOAP::Client;

plan 3;

try require IO::Socket::SSL;
if $! {
skip-rest("IO::Socket::SSL not available");
Expand All @@ -17,4 +16,6 @@ ok $temp, "Got a SOAP::Client object for ConvertTemperature";

my $result = $temp.call('CelsiusToFahrenheit', Celsius => 100);
ok $result, "Got a result for a temperature conversion";
is $result<CelsiusToFahrenheitResult>, 212, "Got correct result";
is $result<CelsiusToFahrenheitResult>, 212, "Got correct result";

# vim: expandtab shiftwidth=4

0 comments on commit ccce16f

Please sign in to comment.