Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage and readme #2

Merged
merged 4 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 4 additions & 49 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,52 +23,7 @@ jobs:
with:
files: |
test-results/junit.xml
base_branch_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- run: npm run test
- name: Upload code coverage for master
if: always()
uses: actions/upload-artifact@v3
with:
name: ref-lcov.info
path: ./test-results/coverage/lcov.info
checks:
runs-on: ubuntu-latest
needs: base_branch_coverage
if: always()
steps:
- uses: actions/checkout@v3
- name: Download base coverage
uses: actions/download-artifact@v3
with:
name: ref-lcov.info
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- run: npm run test
continue-on-error: true
- name: Generate code coverage
if: always()
id: code-coverage
uses: barecheck/code-coverage-action@v1
with:
barecheck-github-app-token: ${{ secrets.BARECHECK_GITHUB_APP_TOKEN }}
lcov-file: "./test-results/coverage/lcov.info"
base-lcov-file: "./lcov.info"
send-summary-comment: true
show-annotations: "warning"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
//registry.npmjs.org/:_authToken=${NPM_DEPLOY}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ez-budgets/test-utils",
"version": "1.0.0",
"version": "1.0.1",
"description": "Packaging meant to help with the process of writing Jest tests",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Test Utils

![Tests](https://github.com/duncanmcpherson/test-utils/actions/workflows/test.yml/badge.svg)
![Build](https://github.com/duncanmcpherson/test-utils/actions/workflows/merge.yml/badge.svg)
[![codecov](https://codecov.io/gh/DuncanMcPherson/test-utils/graph/badge.svg?token=B7FL6TPHO8)](https://codecov.io/gh/DuncanMcPherson/test-utils)