Skip to content

Commit

Permalink
chore: create coverage badges.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 12, 2022
1 parent f9c0138 commit 578d7b2
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI
on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16

- run: npm install

- run: npm run build
- run: npm run doc
- run: cp README.md core
- run: cp -rp core/coverage/lcov-report www/build

- name: Test Case
working-directory: core
run: npm run coverage

- name: Create Coverage Badges
uses: jaywcjlove/coverage-badges-cli@main
with:
source: core/coverage/coverage-summary.json
output: www/build/badges.svg

- name: Create Tag
id: create_tag
uses: jaywcjlove/[email protected]
with:
package-path: ./core/package.json

- name: get tag version
id: tag_version
uses: jaywcjlove/[email protected]

- name: Deploy Website
uses: peaceiris/actions-gh-pages@v3
with:
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./www/build

- name: Generate Changelog
id: changelog
uses: jaywcjlove/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)

- name: Create Release
uses: ncipollo/release-action@v1
if: steps.create_tag.outputs.successful
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.create_tag.outputs.version }}
tag: ${{ steps.create_tag.outputs.version }}
body: |
![No Dependencies](http://jaywcjlove.github.io/sb/status/no-dependencies.svg) [![npm package](https://img.shields.io/npm/v/@wcj/generate-password.svg)](https://www.npmjs.com/package/@wcj/generate-password)
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/generate-password/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
```bash
npm i @wcj/generate-password@${{steps.changelog.outputs.version}}
```
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: core/package.json
6 changes: 6 additions & 0 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"test": "tsbb test",
"coverage": "tsbb test --coverage"
},
"jest": {
"coverageReporters": [
"lcov",
"json-summary"
]
},
"files": [
"src",
"cjs",
Expand Down

0 comments on commit 578d7b2

Please sign in to comment.