diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml new file mode 100644 index 0000000..95f8e4c --- /dev/null +++ b/.github/workflows/codecov.yaml @@ -0,0 +1,44 @@ +name: codecov + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Cache + id: npm-cache + uses: actions/cache@v4 + with: + path: ./node_modules + key: ${{ runner.os }}-npm-cache-${{ hashFiles('package-lock.json') }} + + - name: Install + if: steps.npm-cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Lint + run: npm run lint + + - name: Test + run: npm test -- --coverage + + - name: Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: notebox/nb-crdt \ No newline at end of file diff --git a/README.md b/README.md index 7ca3fed..1be73c6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # nb-crdt +[![codecov](https://codecov.io/gh/notebox/nb-crdt/graph/badge.svg?token=65QQDKPEPV)](https://codecov.io/gh/notebox/nb-crdt) [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/notebox) A block based Conflict-free Replicated Data Type that enables collaborative editing across multiple participants allowing for flexible data sharing across spreadsheets, boards, rich text, and more.