Skip to content

Commit

Permalink
Added Appveyor CI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jan 7, 2025
1 parent d8a1dc2 commit 8b32100
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 6 deletions.
48 changes: 48 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
version: 1.0.{build}

image:
- Visual Studio 2015
- Visual Studio 2017
- Visual Studio 2019
- ubuntu1804
- Ubuntu

environment:
PERL5LIB: /home/appveyor/perl5/lib/perl5
AUTOMATED_TESTING: 1
# TEST_VERBOSE: 1
DEBIAN_FRONTEND: noninteractive
PERL_MM_USE_DEFAULT: 1
NO_NETWORK_TESTING: 1

platform: x64

branches:
only:
- master

skip_tags: true

install:
- cmd: if not exist "C:\strawberry" cinst StrawberryPerl --allow-empty-checksums
- cmd: path C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH%
# - cmd: cd C:\projects\%APPVEYOR_PROJECT_NAME%
# Currently fails on http://apt.postgresql.org/pub/repos/apt bionic-pgdg Release
- sh: sudo apt update -q -y
- sh: sudo DEBIAN_FRONTEND=noninteractive apt-get install -q -y --force-yes build-essential git libssl-dev perl
- sh: export PATH=/home/appveyor/perl5/bin:$PATH
- perl -V
- cmd: mkdir %APPVEYOR_BUILD_FOLDER%\tmp
- cmd: set TMPDIR=%APPVEYOR_BUILD_FOLDER%\tmp
- cpan App::cpanminus
- cmd: cpanm -q --showdeps --with-develop --with-suggests . | findstr /v "^perl\>" | cpanm -qin --skip-satisfied
- cpanm -qin --skip-satisfied --installdeps .
- cmd: 'echo End install at: & time /t'

build_script:
- perl Makefile.PL

test_script:
- cmd: gmake test
- sh: make test
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
# See https://github.com/actions/virtual-environments
# https://github.com/marketplace/actions/setup-perl-environment

name: Test Code
on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
schedule:
- cron: '22 0 7 * *'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
perl: ['5.40', '5.38', '5.36', '5.34', '5.32', '5.30', '5.28', '5.22']
name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
- run: perl -V
- name: Install Dependencies
env:
AUTOMATED_TESTING: 1
run: |
cpanm -iqn ExtUtils::MakeMaker Test::Most
cpanm -iqn --skip-satisfied --installdeps --notest .
- name: Make Module
env:
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
NO_NETWORK_TESTING: 1
NONINTERACTIVE_TESTING: 1
run: |
# find . -name build.log | xargs cat
perl Makefile.PL
make
- name: Run Tests
env:
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
NO_NETWORK_TESTING: 1
NONINTERACTIVE_TESTING: 1
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: prove -l -b t
# run: |
# cover -test
# cover -report codecov
# curl -Os https://uploader.codecov.io/latest/macos/codecov
# chmod +x codecov
# ./codecov -t ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Changes
examples/improver
lib/Grammar/Improver.pm
LICENSE
Makefile.PL
MANIFEST This list of files
README.md
t/30-basics.t
t/comment-spelling.t
t/eof.t
t/eol.t
14 changes: 8 additions & 6 deletions lib/Grammar/Improver.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ our $VERSION = '0.01';
The C<Grammar::Improver> module interfaces with the LanguageTool API to analyze and improve grammar in text input.
=head1 AUTHOR
Nigel Horne <njh@bandsman.co.uk>
=head1 METHODS
=head2 new
Expand Down Expand Up @@ -95,13 +91,13 @@ sub improve_grammar {
my $response = $ua->post(
$self->{api_url},
Content_Type => 'application/x-www-form-urlencoded',
Content => $payload,
Content => $payload,
);

# Check for errors
if ($response->is_success) {
my $response_content = $response->decoded_content;
my $response_data = decode_json($response_content);
my $response_data = decode_json($response_content);

# ::diag(Data::Dumper->new([$response_data])->Dump());

Expand All @@ -122,6 +118,12 @@ sub improve_grammar {
}
}

=head1 AUTHOR
Nigel Horne <njh@bandsman.co.uk>
=cut

1;

__END__
15 changes: 15 additions & 0 deletions t/comment-spelling.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!usr/bin/env perl

use 5.006;
use strict;
use warnings;

use Test::DescribeMe qw(author);
use Test::Most;
use Test::Needs { 'Test::Spelling::Comment' => '0.002' };

Test::Spelling::Comment->import();
Test::Spelling::Comment->new()->add_stopwords(<DATA>)->all_files_ok();

__DATA__
LanguageTool

0 comments on commit 8b32100

Please sign in to comment.