diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3e4c18c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + - run: yarn install --frozen-lockfile + - run: yarn lint + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + - run: yarn install --frozen-lockfile + - run: yarn test --coverage + - uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + fail_ci_if_error: true + + build: + name: Build + runs-on: ubuntu-latest + needs: [lint, test] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + - run: yarn install --frozen-lockfile + - run: yarn build diff --git a/README.md b/README.md index e310050..8a91ac9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Relaycode: Rethinking Extrinsics in Polkadot +[![CI](https://github.com/itsyogesh/relaycode/actions/workflows/ci.yml/badge.svg)](https://github.com/itsyogesh/relaycode/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/itsyogesh/relaycode/branch/master/graph/badge.svg)](https://codecov.io/gh/itsyogesh/relaycode) +[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue.svg)](https://www.typescriptlang.org/) +[![W3F Grant](https://img.shields.io/badge/Web3_Foundation-Grant-green.svg)](https://grants.web3.foundation/) ## Project Overview Relaycode is an intuitive extrinsics builder designed to transform the way developers and users interact with extrinsics in the Polkadot ecosystem. By bridging the gap between complex pallet operations and user-friendly interfaces, Relaycode gives both regular users and developers the ability to harness the full potential of extrinsics the Polkadot ecosystem. diff --git a/jest.config.ts b/jest.config.ts index 3ed582d..2d53ae3 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -31,6 +31,16 @@ const config: Config = { "^@/(.*)$": "/$1", }, testPathIgnorePatterns: ["/node_modules/", "__tests__/helpers/"], + collectCoverageFrom: [ + "lib/**/*.{ts,tsx}", + "components/**/*.{ts,tsx}", + "hooks/**/*.{ts,tsx}", + "config/**/*.{ts,tsx}", + "context/**/*.{ts,tsx}", + "!**/*.d.ts", + "!**/index.ts", + ], + coverageReporters: ["lcov", "text", "text-summary"], }; // Use async config to modify transformIgnorePatterns after next/jest builds them