frontend coverage test & report

This commit is contained in:
Ulf Gebhardt 2021-04-13 23:59:14 +02:00
parent 17f20c1f09
commit a79947e37a
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
2 changed files with 23 additions and 2 deletions

View File

@ -238,4 +238,25 @@ jobs:
- name: backend | docker-compose - name: backend | docker-compose
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp
- name: webapp | Unit tests - name: webapp | Unit tests
run: docker-compose exec -T webapp yarn test run: |
docker-compose -v ~/coverage:/app/coverage exec -T webapp yarn test
cp -r ~/coverage ./coverage
##########################################################################
# COVERAGE REPORT FRONTEND ################################################
##########################################################################
# TODO: Maybe remove this later on to avoid spam?
- name: frontend | Coverage report
uses: romeovs/lcov-reporter-action@v0.2.21
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: ./coverage/lcov.info
##########################################################################
# COVERAGE CHECK FRONTEND ################################################
##########################################################################
- name: frontend | Coverage check
uses: devmasx/coverage-check-action@v1.2.0
with:
type: lcov
result_path: ./coverage/lcov.info
min_coverage: 45
token: ${{ github.token }}

View File

@ -17,7 +17,7 @@
"lint": "eslint --ext .js,.vue .", "lint": "eslint --ext .js,.vue .",
"locales": "../scripts/translations/missing-keys.sh && ../scripts/translations/sort.sh", "locales": "../scripts/translations/missing-keys.sh && ../scripts/translations/sort.sh",
"precommit": "yarn lint", "precommit": "yarn lint",
"test": "cross-env NODE_ENV=test jest", "test": "cross-env NODE_ENV=test jest --coverage",
"test:unit:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --no-cache --runInBand" "test:unit:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --no-cache --runInBand"
}, },
"jest": { "jest": {