├── .github └── workflows │ ├── linux.yml │ ├── macos.yml │ └── windows.yml ├── LICENSE ├── README.md ├── cpanfile ├── lib └── Sample.pm └── t └── test.t /.github/workflows/linux.yml: -------------------------------------------------------------------------------- 1 | name: linux 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | tags-ignore: 8 | - '*' 9 | pull_request: 10 | 11 | jobs: 12 | perl: 13 | 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | matrix: 18 | perl-version: 19 | - '5.8-buster' 20 | - '5.10-buster' 21 | - '5.16-buster' 22 | - 'latest' 23 | - 'threaded' 24 | 25 | container: 26 | image: perl:${{ matrix.perl-version }} 27 | 28 | steps: 29 | - uses: actions/checkout@v2 30 | - name: perl -V 31 | run: perl -V 32 | - name: Install Dependencies 33 | run: curl -sL https://git.io/cpm | perl - install -g --show-build-log-on-failure 34 | - name: Run Tests 35 | run: prove -l t 36 | -------------------------------------------------------------------------------- /.github/workflows/macos.yml: -------------------------------------------------------------------------------- 1 | name: macos 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | tags-ignore: 8 | - '*' 9 | pull_request: 10 | 11 | jobs: 12 | perl: 13 | 14 | runs-on: macOS-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v2 18 | - name: Set up Perl 19 | run: brew install perl 20 | - name: perl -V 21 | run: perl -V 22 | - name: Install Dependencies 23 | run: curl -sL https://git.io/cpm | perl - install -g --show-build-log-on-failure 24 | - name: Run Tests 25 | run: prove -l t 26 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: windows 2 | 3 | on: 4 | push: 5 | branches: 6 | - '*' 7 | tags-ignore: 8 | - '*' 9 | pull_request: 10 | 11 | jobs: 12 | perl: 13 | 14 | runs-on: windows-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v2 18 | - name: Set up Perl 19 | run: | 20 | choco install strawberryperl 21 | echo "C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin" >> $GITHUB_PATH 22 | - name: perl -V 23 | run: perl -V 24 | - name: Install Dependencies 25 | run: curl -sL https://git.io/cpm | perl - install -g --show-build-log-on-failure 26 | - name: Run Tests 27 | run: prove -l t 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Shoichi Kaji 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Perl meets GitHub Actions 2 | 3 | [![](https://github.com/skaji/perl-github-actions-sample/workflows/linux/badge.svg)](https://github.com/skaji/perl-github-actions-sample/actions) [![](https://github.com/skaji/perl-github-actions-sample/workflows/macos/badge.svg)](https://github.com/skaji/perl-github-actions-sample/actions) [![](https://github.com/skaji/perl-github-actions-sample/workflows/windows/badge.svg)](https://github.com/skaji/perl-github-actions-sample/actions) 4 | 5 | See https://medium.com/@skaji/perl-meets-github-actions-3893ae100205 6 | -------------------------------------------------------------------------------- /cpanfile: -------------------------------------------------------------------------------- 1 | requires 'Plack'; 2 | 3 | on test => sub { 4 | requires 'HTTP::Request::Common'; 5 | requires 'Test::More', '0.98'; 6 | }; 7 | -------------------------------------------------------------------------------- /lib/Sample.pm: -------------------------------------------------------------------------------- 1 | package Sample; 2 | use strict; 3 | use warnings; 4 | 5 | sub app { 6 | sub { 7 | my $env = shift; 8 | [200, [], ['Hello World']]; 9 | }; 10 | } 11 | 12 | 1; 13 | -------------------------------------------------------------------------------- /t/test.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Test::More; 4 | 5 | use Plack::Test; 6 | use HTTP::Request::Common; 7 | use Sample; 8 | 9 | my $app = Sample->app; 10 | my $test = Plack::Test->create($app); 11 | 12 | my $res = $test->request(GET '/'); 13 | is $res->code, 200; 14 | 15 | done_testing; 16 | --------------------------------------------------------------------------------