Skip to content

Add code coverage #3024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
---
name: test
on: [pull_request]
on:
push:
branches:
- "master"
pull_request:
branches:
- "*"
workflow_dispatch:

jobs:
docker:
Expand All @@ -11,7 +18,9 @@ jobs:
- name: docker build
run: docker build . -t metacpan/metacpan-web:latest
- name: run Perl tests
run: docker run -i metacpan/metacpan-web carton exec prove -lr --jobs 2 t
run: >
docker run -i metacpan/metacpan-web
carton exec prove -lr --jobs 2 t
test:
runs-on: ubuntu-20.04
name: Dockerless
Expand All @@ -21,8 +30,8 @@ jobs:
perl-version:
- "5.30"
resolver:
- metacpan
- snapshot
- metacpan
container:
image: perl:${{ matrix.perl-version }}
env:
Expand All @@ -48,9 +57,27 @@ jobs:
--resolver ${{ matrix.resolver }}
--show-build-log-on-failure
--local-lib-contained=local
- name: Maybe update cpanfile.snapshot
run: carton
- name: Run Tests
- name: Run tests without coverage
if: matrix.resolver != 'snapshot'
run: carton exec prove -lr --jobs 2 t
env:
TEST_TIDYALL_VERBOSE: 1
- name: Install Codecovbash
if: matrix.resolver == 'snapshot'
uses: perl-actions/install-with-cpm@stable
with:
install: |
Devel::Cover
Devel::Cover::Report::Codecov
Devel::Cover::Report::Codecovbash
sudo: false
- name: Run tests with coverage
if: matrix.resolver == 'snapshot'
run: carton exec prove -lr --jobs 2 t
env:
HARNESS_PERL_SWITCHES: -MDevel::Cover
- name: Upload coverage reports to Codecov
if: matrix.resolver == 'snapshot'
run: cover -report codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Loading