From 15580dd76c42551ba81fde5e2b39b0486628b004 Mon Sep 17 00:00:00 2001 From: Neven Dyulgerov Date: Sat, 30 Sep 2023 19:02:33 +0300 Subject: [PATCH] #10 Add test coverage report (#12) --- .github/workflows/deploy.yaml | 6 ++++++ .github/workflows/docker.yaml | 6 ++++++ README.md | 1 + vitest.config.ts | 10 ++++++++++ 4 files changed, 23 insertions(+) create mode 100644 vitest.config.ts diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 7f49046..a17f9aa 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -29,6 +29,12 @@ jobs: - name: Run tests run: npm run ci:test + - name: Publish coveralls report + uses: coverallsapp/github-action@master + with: + path-to-lcov: 'coverage/lcov.info' + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Aquarium Login run: npm run sqd:auth env: diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index a293dfc..88658f8 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -32,6 +32,12 @@ jobs: - name: Run tests run: npm run ci:test + - name: Publish coveralls report + uses: coverallsapp/github-action@master + with: + path-to-lcov: 'coverage/lcov.info' + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta id: docker_meta uses: docker/metadata-action@v4 diff --git a/README.md b/README.md index 56614f5..28c266b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ## Rollups Explorer Backend +[![Coverage Status](https://coveralls.io/repos/github/cartesi/rollups-explorer-api/badge.svg?branch=main)](https://coveralls.io/github/cartesi/rollups-explorer-api?branch=main) Experimentation with subsquid as a new indexing protocol. diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..d29c8d8 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vitest/config' +import { UserConfig } from 'vitest'; + +export default defineConfig({ + test: { + coverage: { + reporter: ['text', 'lcov'], + }, + } as UserConfig, +}) \ No newline at end of file