diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07888c6d..c56c9bb1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,8 +34,13 @@ jobs: id: testWithCache run: yarn turbo lint test build --cache-dir=.turbo continue-on-error: true - + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + flags: UnitTests + token: ${{ secrets.CODECOV_TOKEN }} + - name: Try to do again without cache if: failure() && steps.testWithCache.outcome == 'failure' run: yarn turbo lint test build --force --cache-dir=.turbo - diff --git a/adapters/aptos-wallet-adapter-plugin/package.json b/adapters/aptos-wallet-adapter-plugin/package.json index b54036ee..00faba6a 100644 --- a/adapters/aptos-wallet-adapter-plugin/package.json +++ b/adapters/aptos-wallet-adapter-plugin/package.json @@ -14,7 +14,7 @@ }, "scripts": { "build": "tsup src/index.ts --format esm,cjs --dts", - "test": "jest", + "test": "jest --coverage=true --coverage-reporters=text", "lint": "eslint src --ext .ts" }, "dependencies": { diff --git a/adapters/rainbowkit-connector/package.json b/adapters/rainbowkit-connector/package.json index 72ee4322..a87a8faf 100644 --- a/adapters/rainbowkit-connector/package.json +++ b/adapters/rainbowkit-connector/package.json @@ -30,6 +30,7 @@ }, "scripts": { "build": "tsup src/index.ts --format esm,cjs --dts", + "test": "jest --coverage=true --coverage-reporters=text", "lint": "eslint src --ext .ts" }, "dependencies": { diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..37931f72 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,51 @@ +coverage: + status: + project: + default: + target: 80% + threshold: 1% + patch: + default: + target: auto + threshold: 5% + +component_management: + default_rules: # default rules that will be inherited by all components + statuses: + - type: project + target: 80% + - type: patch + target: 80% + + individual_components: + - component_id: 'blocto-sdk' + paths: + - /packages/blocto-sdk/src/ + - component_id: 'dappauth' + paths: + - /packages/dappauth/src/ + - component_id: 'aptos-wallet-adapter-plugin' + paths: + - /adapters/aptos-wallet-adapter-plugin/src/ + - component_id: 'connectkit-connector' + paths: + - /adapters/connectkit-connector/src/ + - component_id: 'rainbowkit-connector' + paths: + - /adapters/rainbowkit-connector/src/ + - component_id: 'wagmi-connector' + paths: + - /adapters/wagmi-connector/src/ + - component_id: 'web3-react-connector' + paths: + - /adapters/web3-react-connector/src/ + - component_id: 'web3modal-connector' + paths: + - /adapters/web3modal-connector/src/ + +comment: + layout: 'header, diff, flags, components' + behavior: 'default' + require_changes: false + require_base: no + require_head: no diff --git a/packages/blocto-sdk/package.json b/packages/blocto-sdk/package.json index 30159fba..1fa5950f 100644 --- a/packages/blocto-sdk/package.json +++ b/packages/blocto-sdk/package.json @@ -21,7 +21,7 @@ "build": "NODE_ENV=production rollup -c", "clean": "rimraf dist", "lint": "eslint --ext .js,.ts src/", - "test": "jest", + "test": "jest --coverage=true --coverage-reporters=text", "prepublishOnly": "npm-run-all clean build", "rollup-watch": "NODE_ENV=development rollup -c rollup.config.dev.js --watch", "serve": "live-server --port=7777 --https=dev-cert/index.js dev",