Skip to content

Commit

Permalink
Added Codecov, modified c8 and mocha configs, and standardized packag…
Browse files Browse the repository at this point in the history
…e.json

Signed-off-by: Frank Hinek <[email protected]>
  • Loading branch information
frankhinek committed May 30, 2023
1 parent f09dcc1 commit 58f5b78
Show file tree
Hide file tree
Showing 23 changed files with 337 additions and 948 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/tests-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests in Node and Browsers
name: Continuous Integration

on:
push:
Expand All @@ -12,6 +12,20 @@ on:
workflow_dispatch:

jobs:
security-audit:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 18

- name: Report known vulnerabilities
run: npm audit

test-with-node:
runs-on: ubuntu-latest
steps:
Expand All @@ -36,6 +50,11 @@ jobs:
- name: Run tests for all packages
run: npm run test:node --ws

- name: Upload test coverage to Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test-with-browsers:
# Run browser tests using macOS so that WebKit tests don't fail under a Linux environment
runs-on: macos-latest
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![NPM](https://img.shields.io/npm/v/@tbd54566975/web5.svg?style=flat-square&logo=npm&logoColor=FFFFFF&color=FFEC19&santize=true)](https://www.npmjs.com/package/@tbd54566975/web5)
[![Build Status](https://img.shields.io/github/actions/workflow/status/TBD54566975/web5-js/tests-ci.yml?branch=main&logo=github&label=ci&logoColor=FFFFFF&style=flat-square)](https://github.com/TBD54566975/web5-js/actions/workflows/tests-ci.yml)
[![Coverage](https://img.shields.io/codecov/c/gh/frankhinek/test-web5-js/main?logo=codecov&logoColor=FFFFFF&style=flat-square&token=YI87CKF1LI)](https://codecov.io/github/TBD54566975/web5-js)
[![License](https://img.shields.io/npm/l/@tbd54566975/web5.svg?style=flat-square&color=24f2ff&logo=apache&logoColor=FFFFFF&santize=true)](https://github.com/TBD54566975/web5-js/blob/main/LICENSE)
[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg?style=flat-square&color=9a1aff&logo=discord&logoColor=FFFFFF&sanitize=true)](https://discord.com/channels/937858703112155166/969272658501976117)

Expand Down
45 changes: 45 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
comment:
layout: "header, diff, components"

component_management:
default_rules:
statuses:
- type: project
target: auto # auto compares coverage to the previous base commit
threshold: 10% # allows a 10% drop from the previous base commit coverage
- type: patch
target: 100 # every PR opened should strive for full test coverage

individual_components:
- component_id: package_crypto
name: crypto
paths: ["packages/crypto/**"]

- component_id: package_dids
name: dids
paths: ["packages/dids/**"]

- component_id: package-web5
name: web5
paths: ["packages/web5/**"]

- component_id: package-web5-agent
name: web5-agent
paths: ["packages/web5-agent/**"]

- component_id: package-web5-proxy-agent
name: web5-proxy-agent
paths: ["packages/web5-proxy-agent/**"]

- component_id: package-web5-user-agent
name: web5-user-agent
paths: ["packages/web5-user-agent/**"]

coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true # Don't gate PRs based on Codecov passing thresholds
Loading

0 comments on commit 58f5b78

Please sign in to comment.