-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
13 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 |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
# Use the latest 2.1 version of CircleCI pipeline process engine. See: | ||
# https://circleci.com/docs/2.0/configuration-reference | ||
version: 2.1 | ||
orbs: | ||
codecov: codecov/[email protected] | ||
# Orchestrate or schedule a set of jobs | ||
workflows: | ||
docker-compose: | ||
|
@@ -46,14 +48,9 @@ jobs: | |
pushd metacpan-docker | ||
./src/metacpan-api/wait-for-es.sh http://localhost:9200 elasticsearch_test -- | ||
name: wait for ES | ||
# We are running coverage inside the container, but creating the report | ||
# from outside of the container, so Devel::Cover is installed twice. We | ||
# are relying on environment variables from the host to be available when | ||
# We are relying on environment variables from the host to be available when | ||
# we publish the report, so we publish from the host rather than trying | ||
# to propagate env variables to the container. There is a CircleCI orb | ||
# that can publish the report for us, but it is hard to debug. I had to | ||
# set up the following config in order to debug the orb, so we may as | ||
# well keep it around for now. | ||
# to propagate env variables to the container. | ||
- run: | ||
command: | | ||
pushd metacpan-docker | ||
|
@@ -64,16 +61,19 @@ jobs: | |
pushd metacpan-docker | ||
docker-compose exec -T api_test env HARNESS_PERL_SWITCHES="-MDevel::Cover=+ignore,^t/|^test-data/|^etc/" prove -lr --jobs 4 t | ||
name: run tests with coverage | ||
# The report ends up being owned by root. We need to chown it so that | ||
# the cover command can make changes to it. | ||
- run: | ||
command: | | ||
pushd metacpan-docker/src/metacpan-api | ||
sudo apt install cpanminus | ||
sudo cpanm --notest Devel::Cover Devel::Cover::Report::Codecov | ||
cover -report json | ||
name: create coverage report | ||
# The report ends up being owned by root, but we may not need to chown it. | ||
- run: | ||
command: | | ||
pushd metacpan-docker/src/metacpan-api | ||
sudo chown -R circleci.circleci cover_db | ||
cover -report codecov | ||
name: upload coverage report | ||
name: chown coverage report | ||
- codecov/upload: | ||
file: metacpan-docker/src/metacpan-api/cover_db/cover.json | ||
- run: | ||
command: | | ||
pushd metacpan-docker | ||
|