Skip to content

Commit 83d7926

Browse files
committed
Use codecov orb for report upload
1 parent 0396c11 commit 83d7926

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

.circleci/config.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Use the latest 2.1 version of CircleCI pipeline process engine. See:
33
# https://circleci.com/docs/2.0/configuration-reference
44
version: 2.1
5+
orbs:
6+
codecov: codecov/codecov@4.1.0
57
# Orchestrate or schedule a set of jobs
68
workflows:
79
docker-compose:
@@ -46,14 +48,9 @@ jobs:
4648
pushd metacpan-docker
4749
./src/metacpan-api/wait-for-es.sh http://localhost:9200 elasticsearch_test --
4850
name: wait for ES
49-
# We are running coverage inside the container, but creating the report
50-
# from outside of the container, so Devel::Cover is installed twice. We
51-
# are relying on environment variables from the host to be available when
51+
# We are relying on environment variables from the host to be available when
5252
# we publish the report, so we publish from the host rather than trying
53-
# to propagate env variables to the container. There is a CircleCI orb
54-
# that can publish the report for us, but it is hard to debug. I had to
55-
# set up the following config in order to debug the orb, so we may as
56-
# well keep it around for now.
53+
# to propagate env variables to the container.
5754
- run:
5855
command: |
5956
pushd metacpan-docker
@@ -64,16 +61,19 @@ jobs:
6461
pushd metacpan-docker
6562
docker-compose exec -T api_test env HARNESS_PERL_SWITCHES="-MDevel::Cover=+ignore,^t/|^test-data/|^etc/" prove -lr --jobs 4 t
6663
name: run tests with coverage
67-
# The report ends up being owned by root. We need to chown it so that
68-
# the cover command can make changes to it.
6964
- run:
7065
command: |
7166
pushd metacpan-docker/src/metacpan-api
72-
sudo apt install cpanminus
73-
sudo cpanm --notest Devel::Cover Devel::Cover::Report::Codecov
67+
cover -report json
68+
name: create coverage report
69+
# The report ends up being owned by root, but we may not need to chown it.
70+
- run:
71+
command: |
72+
pushd metacpan-docker/src/metacpan-api
7473
sudo chown -R circleci.circleci cover_db
75-
cover -report codecov
76-
name: upload coverage report
74+
name: chown coverage report
75+
- codecov/upload:
76+
file: metacpan-docker/src/metacpan-api/cover_db/cover.json
7777
- run:
7878
command: |
7979
pushd metacpan-docker

0 commit comments

Comments
 (0)