How to fix View history of project code coverage
I am trying to set up Code coverage | GitLab
I am using GitLab v16.0
This is my yaml
# .gitlab-ci.yml
image: node:12
# Define the stages of the pipeline
stages:
- test
- pages
cache:
paths:
- node_modules/
# Define the job that will run tests
test:
stage: test
script:
- npm install
- npm run test -- --coverage --verbose
artifacts:
when: always
paths:
- junit.xml
- coverage/cobertura-coverage.xml
reports:
coverage_report:
coverage_format: cobertura
path: coverage/cobertura-coverage.xml
junit: junit.xml
# Add coverage to code coverage statistics
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
# Define when this job should be executed
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
pages:
stage: pages
dependencies:
- test
script:
- mv coverage/ public/
artifacts:
paths:
- public
expire_in: 30 days
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
Also when I try to use badges I get “uknown” as the result localdomain.com/parentfolder/project/badges/master/coverage.svg
The only thing i do see working is