-
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We now have Image::Magick, so make sure that is handled better.
- Loading branch information
Showing
11 changed files
with
212 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Coverage | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Run coverage tests | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
part: [ 1, 2, 3 ] | ||
|
||
env: | ||
PERL5LIB: local-coverage/lib/perl5 | ||
HARNESS_PERL_SWITCHES: "-MDevel::Cover=+ignore,local/lib/perl5,commonlib,perllib/Catalyst/[^A],perllib/Email,Test.pm,^t" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- uses: niden/actions-memcached@v7 | ||
|
||
- name: Setup cache (carton) | ||
uses: actions/cache@v2 | ||
with: | ||
path: local | ||
key: ${{ runner.os }}-carton-${{ hashFiles('cpanfile.snapshot') }} | ||
|
||
- name: Setup cache (coverage) | ||
uses: actions/cache@v2 | ||
with: | ||
path: local-coverage | ||
key: ${{ runner.os }}-coverage | ||
|
||
- name: Install packages | ||
run: | | ||
sudo apt install -y gettext language-pack-en language-pack-de language-pack-sv libimage-magick-perl | ||
vendor/bin/carton install --deployment | ||
commonlib/bin/gettext-makemo FixMyStreet | ||
bin/cpanm --quiet --notest -l local-coverage Devel::Cover::Report::Codecov JSON::MaybeXS | ||
- name: Run tests (with coverage, part 1) | ||
if: matrix.part == 1 | ||
run: script/test --jobs 3 $(find t/app/controller -name "[a-q]*.t") | ||
|
||
- name: Run tests (with coverage, part 2) | ||
if: matrix.part == 2 | ||
run: script/test --jobs 3 $(find t/app/controller -name "[r-z]*.t") | ||
|
||
- name: Run tests (with coverage, part 3) | ||
if: matrix.part == 3 | ||
run: script/test --jobs 3 $(find t -name "*.t" ! -path "t/app/controller*") | ||
|
||
- name: Generate coverage report | ||
if: success() | ||
run: local-coverage/bin/cover --report codecov | ||
env: | ||
PERL5LIB: 'local-coverage/lib/perl5:perllib' | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Cypress | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Run Cypress tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 8.x | ||
|
||
- name: Setup cache (carton) | ||
uses: actions/cache@v2 | ||
with: | ||
path: local | ||
key: ${{ runner.os }}-carton-${{ hashFiles('cpanfile.snapshot') }} | ||
|
||
- name: Setup cache (cypress) | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.npm | ||
node_modules | ||
key: ${{ runner.os }}-node-8-cypress-3.8.3 | ||
|
||
- name: Install packages | ||
run: | | ||
sudo apt install -y gettext | ||
npm install [email protected] | ||
vendor/bin/carton install --deployment | ||
commonlib/bin/gettext-makemo FixMyStreet | ||
echo "$(npm bin)" >> $GITHUB_PATH | ||
- name: Run Cypress tests | ||
run: | | ||
bin/browser-tests run ${CYPRESS_RECORD_KEY:+--record} | ||
env: | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Test on perl ${{ matrix.perl_version }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# stretch, buster, focal/bullseye, xenial, trusty | ||
# bionic 5.26 is ubuntu-latest, in coverage run | ||
perl_version: [ 5.24.4, 5.28.3, 5.30.3, 5.22.4, 5.18.4 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Setup cache (carton) | ||
uses: actions/cache@v2 | ||
with: | ||
path: local | ||
key: ${{ runner.os }}-perl-${{ matrix.perl_version }}-carton-${{ hashFiles('cpanfile.snapshot') }} | ||
|
||
- name: Setup cache (perl) | ||
id: cache-perl | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/perl5 | ||
key: ${{ runner.os }}-perl-${{ matrix.perl_version }} | ||
|
||
- name: Install correct perl | ||
if: steps.cache-perl.outputs.cache-hit != 'true' | ||
run: | | ||
wget -qO - https://install.perlbrew.pl | bash | ||
~/perl5/perlbrew/bin/perlbrew install --notest ${{ matrix.perl_version }} | ||
~/perl5/perlbrew/bin/perlbrew clean | ||
- name: Add packages | ||
run: | | ||
sudo apt install -y gettext language-pack-en language-pack-de language-pack-sv libimage-magick-perl | ||
~/perl5/perlbrew/bin/perlbrew exec vendor/bin/carton install --deployment | ||
commonlib/bin/gettext-makemo FixMyStreet | ||
- name: Run tests | ||
run: ~/perl5/perlbrew/bin/perlbrew exec script/test --jobs 3 t |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package Devel::Cover::Report::Codecov::Service::GitHub; | ||
use strict; | ||
use warnings; | ||
use utf8; | ||
|
||
sub detect { | ||
return $ENV{GITHUB_ACTIONS}; | ||
} | ||
|
||
sub configuration { | ||
(my $branch = $ENV{GITHUB_REF}) =~ s{^refs/heads/}{}; | ||
|
||
my $conf = { | ||
service => 'github-actions', | ||
commit => $ENV{GITHUB_SHA}, | ||
slug => $ENV{GITHUB_REPOSITORY}, | ||
build => $ENV{GITHUB_RUN_ID}, | ||
build_url => "https://github.com/$ENV{GITHUB_REPOSITORY}/actions/runs/$ENV{GITHUB_RUN_ID}", | ||
branch => $branch, | ||
}; | ||
|
||
if ($ENV{GITHUB_HEAD_REF}) { | ||
(my $pr = $ENV{GITHUB_REF}) =~ s{^refs/pull/}{}; | ||
$pr =~ s{/merge$}{}; | ||
$conf->{pr} = $pr; | ||
$conf->{branch} = $ENV{GITHUB_HEAD_REF}; | ||
} | ||
|
||
return $conf; | ||
} | ||
|
||
1; | ||
__END__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.