Skip to content

Commit

Permalink
chore: enable test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKruckenberg committed Apr 9, 2021
1 parent f9b3b16 commit 06ab6c7
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Generate Coverage
on:
push:
branches:
- master
- next

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 14.x
lfs: true
- run: yarn
- name: Generate coverage report
run: yarn coverage
- name: Upload imagetools-core Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: imagetools-core
files: 'packages/core/coverage/coverage-final.json'

- name: Upload vite-imagetools Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: vite-imagetools
files: 'packages/vite/coverage/coverage-final.json'

- name: Upload rollup-plugin-imagetools Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: rollup-plugin-imagetools
files: 'packages/rollup/coverage/coverage-final.json'
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"release": "lerna publish",
"test": "lerna run test --stream",
"build": "lerna run build --stream"
"build": "lerna run build --stream",
"coverage": "lerna run coverage --stream"
},
"devDependencies": {
"@commitlint/cli": "^12.0.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
testEnvironment: 'node',
testMatch: [ "**/?(*.)+(spec|test).[jt]s?(x)" ],
collectCoverageFrom: [
"src/**/*.ts"
"src/**/*.ts",
"!**/__tests__/**"
]
};
3 changes: 2 additions & 1 deletion packages/rollup/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
testMatch: [ "**/?(*.)+(spec|test).[jt]s?(x)" ],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
collectCoverageFrom: [
"src/**/*.ts"
"src/**/*.ts",
"!**/__tests__/**"
]
};
3 changes: 2 additions & 1 deletion packages/vite/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
testMatch: [ "**/?(*.)+(spec|test).[jt]s?(x)" ],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
collectCoverageFrom: [
"src/**/*.ts"
"src/**/*.ts",
"!**/__tests__/**"
]
};

0 comments on commit 06ab6c7

Please sign in to comment.