Skip to content

Commit

Permalink
Enforce coverage %.
Browse files Browse the repository at this point in the history
  • Loading branch information
dermotduffy committed Oct 31, 2023
1 parent 45d2e64 commit f67511c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- dev
pull_request:
schedule:
- cron: "17 6 * * *"
- cron: '17 6 * * *'
workflow_dispatch:

jobs:
Expand All @@ -25,23 +25,31 @@ jobs:
- name: Install dependencies
run: yarn install --immutable

- name: Test & Coverage
run: yarn run coverage

- name: Build
run: yarn run build

- name: Test
run: yarn run test

- name: HACS build validation
uses: "hacs/[email protected]"
uses: 'hacs/[email protected]'
with:
category: "plugin"
category: 'plugin'

# Don't attempt to load into HACS (as it loads the release, not the
# build).
ignore: "hacs"
ignore: 'hacs'

- name: Upload artifact
- name: Upload javascript
uses: actions/upload-artifact@v3
with:
name: frigate-hass-card
path: dist/*.js

# When this issue is fixed, it would be useful to upload visualizations:
# https://github.com/actions/upload-artifact/issues/14
# - name: Upload visualizations
# uses: actions/upload-artifact@v3
# with:
# name: frigate-hass-card
# path: visualizations/*.html
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package-lock.json
.env
.envrc

stats.html
/visualizations/
/coverage/

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
Expand Down
5 changes: 4 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ const plugins = [
}),
watch && serve(serveopts),
!dev && terser(),
visualizer(),
visualizer({
filename: 'visualizations/treemap.html',
template: 'treemap',
}),
];

/**
Expand Down
8 changes: 8 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ export default defineConfig({
coverage: {
// Favor istanbul for coverage over v8 due to better accuracy.
provider: 'istanbul',

// Thresholds will automatically be updated as coverage improves to avoid
// back-sliding.
thresholdAutoUpdate: true,
statements: 71.65,
branches: 60.62,
functions: 72.78,
lines: 71.54,
},
},
});

0 comments on commit f67511c

Please sign in to comment.