Skip to content

Commit

Permalink
feat: test badge
Browse files Browse the repository at this point in the history
  • Loading branch information
aelf-lxy committed Jul 29, 2024
1 parent 335a999 commit d864523
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
name: Unit Test

on:
push:
branches:
- release/refactor-3.0.0
- feature/badge
pull_request:
branches:
- release/refactor-3.0.0
on: [push, pull_request, workflow_dispatch]

jobs:
test:
Expand Down Expand Up @@ -45,19 +38,9 @@ jobs:
flags: unittests
name: codecov-umbrella

- name: Generate coverage badge
uses: jaywcjlove/coverage-badges-cli@main
with:
source: packages/${{ matrix.package }}/coverage/coverage-summary.json
output: packages/${{ matrix.package }}/coverage/badge.svg

- name: Upload coverage badge
uses: actions/upload-artifact@v2
with:
name: coverage-badge-${{ matrix.package }}
path: packages/${{ matrix.package }}/coverage/badge.svg
- name: Update Coverage Badge
# GitHub actions: default branch variable
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: we-cli/coverage-badge-action@main

# - name: Generate coverage badge
# run: |
# npm i coverage-badges-cli -g
# coverage-badges --source packages/${{ matrix.package }}/coverage/coverage-summary.json --output packages/${{ matrix.package }}/coverage/badge.svg
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**website**: https://aelf-web-login.vercel.app/

![GitHub Workflow Test Status](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/AElfProject/aelf-web-login/feature/badge-json/feature-badge-test-results.json) ![Coverage](https://aelfproject.github.io/aelf-web-login/packages/utils/coverage/badge.svg)
![GitHub Workflow Test Status](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/AElfProject/aelf-web-login/feature/badge-json/feature-badge-test-results.json) ![Coverage](https://aelfproject.github.io/aelf-web-login/packages/utils/badges/coverage.svg)

# Install

Expand Down

0 comments on commit d864523

Please sign in to comment.