Skip to content

Commit

Permalink
feat: test monorepo coverage badge
Browse files Browse the repository at this point in the history
  • Loading branch information
aelf-lxy committed Aug 2, 2024
1 parent 334ce3f commit e8827e2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,29 @@ jobs:
uses: jaywcjlove/coverage-badges-cli@main
with:
source: packages/${{ matrix.package }}/coverage/coverage-summary.json
output: packages/${{ matrix.package }}/coverage/${{ matrix.package }}-badge.svg
output: packages/${{ matrix.package }}/coverage/badge.svg

- name: Upload coverage report to artifact
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.package }}
path: packages/${{ matrix.package }}/coverage

deploy:
runs-on: ubuntu-latest
needs: coverage

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download coverage artifacts
uses: actions/download-artifact@v3
with:
path: coverage

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: packages/${{ matrix.package }}/coverage
publish_dir: coverage
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to npm
name: Publish
env:
CI: true
on:
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
</a>
<img alt="NPM" src="https://img.shields.io/npm/l/aelf-web-login">
<a href="http://commitizen.github.io/cz-cli/"><img alt="Commitizen friendly" src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg"></a>
<a href="https://github.com/AElfProject/aelf-web-login/actions/workflows/publish.yml">
<img alt="coverage" src="https://github.com/AElfProject/aelf-web-login/actions/workflows/publish.yml/badge.svg">
</a>
</p>

https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/AElfProject/aelf-web-login/feature/badge-json/release-refactor-3.0.0-base-test-results.json

| Branch | GitHub Actions | Tests | Coverage |
<!-- | Branch | GitHub Actions | Tests | Coverage |
| --- | --- | --- | --- |
| `release/refactor-3.0.0` | [![coverage](https://github.com/AElfProject/aelf-web-login/actions/workflows/coverage.yml/badge.svg)](https://github.com/AElfProject/aelf-web-login/actions/workflows/coverage.yml) | ![GitHub Workflow Test Status](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/AElfProject/aelf-web-login/feature/badge-json/release-refactor-3.0.0-utils-test-results.json) | [![Coverage](https://aelfproject.github.io/aelf-web-login/badge.svg)](https://github.com/AElfProject/aelf-web-login/actions) |
| `release/refactor-3.0.0` | [![coverage](https://github.com/AElfProject/aelf-web-login/actions/workflows/coverage.yml/badge.svg)](https://github.com/AElfProject/aelf-web-login/actions/workflows/coverage.yml) | ![GitHub Workflow Test Status](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/AElfProject/aelf-web-login/feature/badge-json/release-refactor-3.0.0-utils-test-results.json) | [![Coverage](https://aelfproject.github.io/aelf-web-login/coverage-base/badge.svg)](https://github.com/AElfProject/aelf-web-login/actions) | -->

| package | Tests | Coverage |
| --- | --- | --- |
| @aelf-web-login/utils | ![GitHub Workflow Test Status](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/AElfProject/aelf-web-login/feature/badge-json/release-refactor-3.0.0-utils-test-results.json) | [![Coverage](https://aelfproject.github.io/aelf-web-login/coverage-utils/badge.svg)](https://github.com/AElfProject/aelf-web-login/actions) |
| @aelf-web-login/base | ![GitHub Workflow Test Status](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/AElfProject/aelf-web-login/feature/badge-json/release-refactor-3.0.0-base-test-results.json) | [![Coverage](https://aelfproject.github.io/aelf-web-login/coverage-base/badge.svg)](https://github.com/AElfProject/aelf-web-login/actions) |

# Install

Expand Down

0 comments on commit e8827e2

Please sign in to comment.