-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DTeam-Top/ci-testing
Ci testing
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ dist | |
*.tgz | ||
.vscode | ||
coverage | ||
xunit.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters