diff options
| author | Shinigami <[email protected]> | 2022-02-04 22:29:50 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-04 22:29:50 +0100 |
| commit | 046d598c8cadd3585a98b968389b4ac95bc00224 (patch) | |
| tree | 98832570af9590514002deeb9f2329f1d544031c | |
| parent | dbb3e144ea9a72a5dfe2ada9adfe70a4e549ccff (diff) | |
| download | faker-046d598c8cadd3585a98b968389b4ac95bc00224.tar.xz faker-046d598c8cadd3585a98b968389b4ac95bc00224.zip | |
ci: configure codecov (#426)
| -rw-r--r-- | .github/.codecov.yml | 6 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 37 | ||||
| -rw-r--r-- | .vscode/extensions.json | 3 | ||||
| -rw-r--r-- | .vscode/settings.json | 4 | ||||
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | vite.config.ts | 14 |
6 files changed, 64 insertions, 1 deletions
diff --git a/.github/.codecov.yml b/.github/.codecov.yml new file mode 100644 index 00000000..3c471565 --- /dev/null +++ b/.github/.codecov.yml @@ -0,0 +1,6 @@ +comment: + layout: 'diff, flags, files' + behavior: default + require_changes: false + require_base: false + require_head: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11bc7fe8..57b725aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,3 +95,40 @@ jobs: - name: Check formatting run: pnpm prettier --check . + + codecov: + runs-on: ubuntu-latest + name: 'Codecov: node-16, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 6 + + - name: Set node version to 16 + uses: actions/setup-node@v2 + with: + node-version: 16 + cache: 'pnpm' + + - name: Install deps + run: pnpm install + env: + CYPRESS_INSTALL_BINARY: 0 + + - name: Build + run: pnpm run build + + - name: Generate coverage report + run: pnpm vitest run --coverage + + - name: Upload coverage to Codecov + uses: codecov/[email protected] + with: + directory: ./coverage + fail_ci_if_error: true diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 17fab0c0..965297c1 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ "recommendations": [ "dbaeumer.vscode-eslint", "editorconfig.editorconfig", - "esbenp.prettier-vscode" + "esbenp.prettier-vscode", + "redhat.vscode-yaml" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index a2caeede..adff015a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,9 @@ "files.associations": { "*.json5": "jsonc" + }, + + "yaml.schemas": { + "https://json.schemastore.org/codecov.json": ".github/.codecov.yml" } } @@ -5,6 +5,7 @@ [](https://chat.fakerjs.dev) [](https://github.com/faker-js/faker/actions/workflows/ci.yml) + [](https://codecov.io/gh/faker-js/faker) [](https://www.npmjs.com/package/@faker-js/faker) [](https://www.npmjs.com/package/@faker-js/faker) [](https://opencollective.com/fakerjs#section-contributors) diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 00000000..13e82b4d --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,14 @@ +/// <reference types="vitest" /> +import { defineConfig } from 'vite'; + +// https://vitejs.dev/config/ +export default defineConfig({ + test: { + coverage: { + all: true, + reporter: ['clover', 'cobertura', 'lcov', 'text'], + // TODO christopher 2022-02-04: Later we want to test `src` instead of `dist/cjs` + include: ['dist/cjs'], + }, + }, +}); |
