Skip to content

Commit

Permalink
Merge pull request #1 from DTeam-Top/ci-testing
Browse files Browse the repository at this point in the history
Ci testing
  • Loading branch information
abcfy2 authored Apr 23, 2023
2 parents 9793ec4 + 530db14 commit 544781b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on: [push, pull_request]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test -- --tap | npx -y tap-xunit --dontUseCommentsAsTestNames > xunit.xml
- name: Test Report
uses: phoenix-actions/test-reporting@v12
id: test-report
if: success() || failure()
with:
name: Test Report
path: xunit.xml
reporter: jest-junit
- name: Code Coverage Summary Report
uses: 5monkeys/cobertura-action@master
with:
path: coverage/cobertura-coverage.xml
minimum_coverage: 75
- name: Set code coverage commit status 📫
run: npx -y -p check-code-coverage set-gh-status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Badge of Code Coverage
if: github.event_name == 'push'
run: npx -y -p check-code-coverage update-badge
- name: Commit files
if: github.event_name == 'push'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "docs: ✏️ update coverage badge" -a || true
- name: Push changes
uses: ad-m/github-push-action@master
if: github.event_name == 'push'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist
*.tgz
.vscode
coverage
xunit.xml
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# safe-signer

![build](https://github.com/DTeam-Top/safe-signer/actions/workflows/ci.yml/badge.svg)
![check-code-coverage](https://img.shields.io/badge/code--coverage-80.13%25-green)
[![npm](https://img.shields.io/npm/dt/@dteam/safe-signer)](https://www.npmjs.com/package/@dteam/safe-signer)
[![npm (scoped)](https://img.shields.io/npm/v/@dteam/safe-signer)](https://www.npmjs.com/package/@dteam/safe-signer)

Expand Down

0 comments on commit 544781b

Please sign in to comment.