Skip to content

Commit d26039d

Browse files
committed
Try to enable coverage in playwright testing
1 parent a118da8 commit d26039d

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,37 @@ jobs:
7171
id: docker-build-test
7272
uses: docker/build-push-action@v6
7373
with:
74-
target: server
74+
target: playwright
7575
push: false
7676
load: true
7777
- name: Run Perl tests
7878
run: >
7979
docker run -d -i -p 8000:80
80+
-e PERL5OPT='-MDevel::Cover=+ignore,^local/|^templates/|^t/|yaml$'
81+
-e HARNESS_ACTIVE=1
82+
-v $(pwd):/app
8083
${{ steps.docker-build-test.outputs.imageid }}
8184
- uses: actions/setup-node@v4
8285
with:
8386
node-version: 22
8487
- name: Install Playwright Browsers
8588
run: ./bin/install-playwright
89+
- name: Install Codecovbash
90+
uses: perl-actions/install-with-cpm@v1
91+
with:
92+
install: |
93+
Devel::Cover
94+
Devel::Cover::Report::Codecovbash
95+
sudo: true
8696
- name: Run Playwright tests
8797
run: npx playwright test
98+
- name: Generate Codecov report
99+
run: cover -report codecovbash
100+
- uses: codecov/codecov-action@v5
101+
with:
102+
fail_ci_if_error: true
103+
file: ./cover_db/codecov.json
104+
token: ${{ secrets.CODECOV_TOKEN }}
88105
test:
89106
runs-on: ubuntu-24.04
90107
name: Dockerless

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,15 @@ CMD [ "prove", "-l", "-r", "-j", "2", "t" ]
123123
FROM server AS production
124124

125125
USER metacpan
126+
127+
################### Playwright Server
128+
FROM server AS playwright
129+
USER root
130+
131+
RUN \
132+
--mount=type=cache,target=/root/.perl-cpm \
133+
<<EOT
134+
cpm install --show-build-log-on-failure Devel::Cover
135+
EOT
136+
137+
USER metacpan

0 commit comments

Comments
 (0)