mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: codecov (#8219)
This commit is contained in:
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -33,5 +33,9 @@ jobs:
|
|||||||
- name: Tests
|
- name: Tests
|
||||||
run: yarn test
|
run: yarn test
|
||||||
|
|
||||||
|
- name: Upload Coverage
|
||||||
|
uses: ./packages/actions/src/uploadCoverage
|
||||||
|
if: github.repository_owner == 'discordjs'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: yarn build --cache-dir=".turbo"
|
run: yarn build --cache-dir=".turbo"
|
||||||
|
|||||||
26
codecov.yml
Normal file
26
codecov.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
codecov:
|
||||||
|
notify:
|
||||||
|
after_n_builds: 6
|
||||||
|
strict_yaml_branch: main
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
range: '50...90'
|
||||||
|
status:
|
||||||
|
project:
|
||||||
|
default:
|
||||||
|
target: auto
|
||||||
|
threshold: 5%
|
||||||
|
informational: true
|
||||||
|
patch: off
|
||||||
|
|
||||||
|
flag_management:
|
||||||
|
default_rules:
|
||||||
|
statuses:
|
||||||
|
- type: project
|
||||||
|
target: auto
|
||||||
|
threshold: 2%
|
||||||
|
informational: true
|
||||||
|
|
||||||
|
comment:
|
||||||
|
require_changes: true
|
||||||
|
after_n_builds: 6
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
"test": "turbo run test && vitest run",
|
"test": "turbo run test",
|
||||||
"lint": "turbo run lint",
|
"lint": "turbo run lint",
|
||||||
"format": "turbo run format",
|
"format": "turbo run format",
|
||||||
"fmt": "turbo run format",
|
"fmt": "turbo run format",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"description": "A set of actions that we use for our workflows",
|
"description": "A set of actions that we use for our workflows",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
||||||
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache"
|
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache"
|
||||||
|
|||||||
52
packages/actions/src/uploadCoverage/action.yml
Normal file
52
packages/actions/src/uploadCoverage/action.yml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
name: 'Upload Coverage'
|
||||||
|
description: 'Uploads code coverage reports to codecov with separate flags for separate packages'
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Upload Builders Coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: ./packages/builders/coverage/clover.xml
|
||||||
|
flags: builders
|
||||||
|
|
||||||
|
- name: Upload Collection Coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: ./packages/collection/coverage/clover.xml
|
||||||
|
flags: collection
|
||||||
|
|
||||||
|
- name: Upload Discord.js Coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: ./packages/discord.js/coverage/clover.xml
|
||||||
|
flags: discord.js
|
||||||
|
|
||||||
|
- name: Upload Proxy Coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: ./packages/proxy/coverage/clover.xml
|
||||||
|
flags: proxy
|
||||||
|
|
||||||
|
- name: Upload Rest Coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: ./packages/rest/coverage/clover.xml
|
||||||
|
flags: rest
|
||||||
|
|
||||||
|
- name: Upload Voice Coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: ./packages/voice/coverage/clover.xml
|
||||||
|
flags: voice
|
||||||
|
|
||||||
|
- name: Upload Website Coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: ./packages/website/coverage/clover.xml
|
||||||
|
flags: website
|
||||||
|
|
||||||
|
- name: Upload Utilities Coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
files: ./packages/actions/coverage/clover.xml, ./packages/docgen/coverage/clover.xml, ./packages/scripts/coverage/clover.xml
|
||||||
|
flags: utilities
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
"version": "0.16.0-dev",
|
"version": "0.16.0-dev",
|
||||||
"description": "A set of builders that you can use when creating your bot",
|
"description": "A set of builders that you can use when creating your bot",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
||||||
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache",
|
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"version": "0.8.0-dev",
|
"version": "0.8.0-dev",
|
||||||
"description": "Utility data structure used in discord.js",
|
"description": "Utility data structure used in discord.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
||||||
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache",
|
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"version": "0.12.0-dev",
|
"version": "0.12.0-dev",
|
||||||
"description": "The docs.json generator for discord.js and its related projects",
|
"description": "The docs.json generator for discord.js and its related projects",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"lint": "prettier --cache --check . && eslint src --ext mjs,js,ts --cache",
|
"lint": "prettier --cache --check . && eslint src --ext mjs,js,ts --cache",
|
||||||
"format": "prettier --cache --write . && eslint src --ext mjs,js,ts --fix --cache",
|
"format": "prettier --cache --write . && eslint src --ext mjs,js,ts --fix --cache",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"version": "1.0.0-dev",
|
"version": "1.0.0-dev",
|
||||||
"description": "Tools for running an HTTP proxy for Discord's API",
|
"description": "Tools for running an HTTP proxy for Discord's API",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
||||||
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache",
|
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"version": "0.6.0-dev",
|
"version": "0.6.0-dev",
|
||||||
"description": "The REST API for discord.js",
|
"description": "The REST API for discord.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
"lint": "prettier --cache --check . && eslint src __tests__ --ext mjs,js,ts --cache",
|
||||||
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache",
|
"format": "prettier --cache --write . && eslint src __tests__ --ext mjs,js,ts --fix --cache",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"description": "A set of scripts that we use for our workflows",
|
"description": "A set of scripts that we use for our workflows",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"lint": "prettier --cache --check . && eslint src --ext mjs,js,ts --cache",
|
"lint": "prettier --cache --check . && eslint src --ext mjs,js,ts --cache",
|
||||||
"format": "prettier --cache --write . && eslint src --ext mjs,js,ts --fix --cache"
|
"format": "prettier --cache --write . && eslint src --ext mjs,js,ts --fix --cache"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"description": "A set of builders that you can use when creating your bot",
|
"description": "A set of builders that you can use when creating your bot",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test": "vitest run",
|
||||||
"build": "yarn build:css && yarn build:remix",
|
"build": "yarn build:css && yarn build:remix",
|
||||||
"build:css": "yarn generate:css",
|
"build:css": "yarn generate:css",
|
||||||
"build:remix": "remix build",
|
"build:remix": "remix build",
|
||||||
|
|||||||
@@ -2,12 +2,15 @@ import { defineConfig } from 'vitest/config';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
test: {
|
test: {
|
||||||
exclude: ['**/node_modules', '**/dist', '.idea', '.git', '.cache', 'packages/discord.js', 'packages/voice'],
|
exclude: ['**/node_modules', '**/dist', '.idea', '.git', '.cache'],
|
||||||
passWithNoTests: true,
|
passWithNoTests: true,
|
||||||
coverage: {
|
coverage: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
all: true,
|
||||||
reporter: ['text', 'lcov', 'clover'],
|
reporter: ['text', 'lcov', 'clover'],
|
||||||
exclude: ['**/dist', '**/__tests__'],
|
include: ['src'],
|
||||||
|
// All ts files that only contain types, due to ALL
|
||||||
|
exclude: ['**/*.{interface,type,d}.ts'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user