Skip to content

Commit

Permalink
ci: add coverage reports (#186)
Browse files Browse the repository at this point in the history
* ci: add code coverage workflow

* ci: update coverage workflow

* docs: add coverage status to readme
  • Loading branch information
tomosterlund authored Jun 29, 2023
1 parent fce5cee commit 1a23000
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Unit test code coverage
on:
pull_request:
push:
branches:
- master

jobs:
code_coverage:
name: Upload to Coveralls
runs-on: ubuntu-latest
steps:
- name: Checkout ✅
uses: actions/checkout@v3
- name: Setup Node.js 🔧
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install dependencies 🛠️
run: npm i
- name: Run Vitest 🧪
run: npx vitest run --coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
7 changes: 0 additions & 7 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ jobs:
start: npm run dev
env: type=actual # for screenshot testing
config: screenshotsFolder=cypress/snapshots/linux/actual
- uses: cypress-io/github-action@v4
if: failure()
with:
browser: chrome
start: npm run dev
env: type=base # for recording screenshots
config: screenshotsFolder=cypress/snapshots/linux/base
- uses: actions/upload-artifact@v3
if: failure()
with:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
![qalendar](https://discover-test-files.s3.eu-central-1.amazonaws.com/Logo+MAIN.png)

[![Build](https://github.com/tomosterlund/qalendar/actions/workflows/build.yml/badge.svg)](https://github.com/tomosterlund/qalendar/actions/workflows/build.yml)
[![Release](https://github.com/tomosterlund/qalendar/actions/workflows/release.yml/badge.svg)](https://github.com/tomosterlund/qalendar/actions/workflows/release.yml)
[![End-to-end tests](https://github.com/tomosterlund/qalendar/actions/workflows/end-to-end-tests.yml/badge.svg)](https://github.com/tomosterlund/qalendar/actions/workflows/end-to-end-tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/tomosterlund/qalendar/badge.svg?branch=master)](https://coveralls.io/github/tomosterlund/qalendar?branch=master)
[![Unit tests](https://github.com/tomosterlund/qalendar/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/tomosterlund/qalendar/actions/workflows/unit-tests.yml)
[![End-to-end tests](https://github.com/tomosterlund/qalendar/actions/workflows/end-to-end-tests.yml/badge.svg)](https://github.com/tomosterlund/qalendar/actions/workflows/end-to-end-tests.yml)
[![npm](https://img.shields.io/npm/v/qalendar)](https://www.npmjs.com/package/qalendar)
![npm](https://img.shields.io/npm/dm/qalendar)

Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default defineConfig({
include: ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
environment: "jsdom",
coverage: {
provider: 'c8'
provider: 'c8',
reporter: ['lcov', 'text-summary'],
},
},
});

0 comments on commit 1a23000

Please sign in to comment.