From 9d5f05efaf9c2d769c91bd3634ff77b8423c3b24 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 26 Apr 2021 14:11:10 -0700 Subject: [PATCH 1/2] refactor: remove old coverage shield workflow --- README.md | 1 - ci/README.md | 14 -------------- ci/build/release-prep.sh | 12 ------------ package.json | 2 -- 4 files changed, 29 deletions(-) diff --git a/README.md b/README.md index ad426e7f7..1dd184a25 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # code-server · [!["GitHub Discussions"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/cdr/code-server/discussions) [!["Join us on Slack"](https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen)](https://cdr.co/join-community) [![Twitter Follow](https://img.shields.io/twitter/follow/CoderHQ?label=%40CoderHQ&style=social)](https://twitter.com/coderhq) -![Lines](https://img.shields.io/badge/Coverage-51.47%25-green.svg) [![See latest docs](https://img.shields.io/static/v1?label=Docs&message=see%20latest%20&color=blue)](https://github.com/cdr/code-server/tree/v3.9.3/docs) Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and access it in the browser. diff --git a/ci/README.md b/ci/README.md index da3a9f6d5..40f7f4b7b 100644 --- a/ci/README.md +++ b/ci/README.md @@ -36,20 +36,6 @@ Any file or directory in this subdirectory should be documented here. 1. Install [homebrew](https://brew.sh/) 2. Run `brew bump-formula-pr --version=3.8.1 code-server` and update the version accordingly. This will bump the version and open a PR. Note: this will only work once the version is published on npm. -## Updating Code Coverage in README - -Currently, we run a command to manually generate the code coverage shield. Follow these steps: - -1. Run `yarn test:unit` and make sure all the tests are passing -2. Run `yarn badges` -3. Go into the README and change the color from `red` to `green` in this line: - -``` -![Lines](https://img.shields.io/badge/Coverage-46.71%25-red.svg) -``` - -NOTE: we have to manually change the color because the default is red if coverage is less than 80. See code [here](https://github.com/olavoparno/istanbul-badges-readme/blob/develop/src/editor.ts#L24-L33). - ## dev This directory contains scripts used for the development of code-server. diff --git a/ci/build/release-prep.sh b/ci/build/release-prep.sh index f0b0334bf..1ffa651c5 100755 --- a/ci/build/release-prep.sh +++ b/ci/build/release-prep.sh @@ -43,14 +43,6 @@ main() { exit fi - # Check that they have sd installed - if ! command -v sd &>/dev/null; then - echo "sd could not be found." - echo "We use this when updating files across the codebase." - echo -e "See docs here: https://github.com/chmln/sd#installation" - exit - fi - # Check that they have node installed if ! command -v node &>/dev/null; then echo "node could not be found." @@ -94,10 +86,6 @@ main() { # Ensure the tests are passing and code coverage is up-to-date echo -e "Running unit tests and updating code coverage...\n" $CMD yarn test:unit - # Updates the Lines badge in the README - $CMD yarn badges - # Updates the svg to be green for the badge - $CMD sd "red.svg" "green.svg" ./README.md $CMD git commit -am "chore(release): bump version to $CODE_SERVER_VERSION_TO_UPDATE" diff --git a/package.json b/package.json index bd211d7ab..44645c403 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "ci": "./ci/dev/ci.sh", "watch": "VSCODE_IPC_HOOK_CLI= NODE_OPTIONS=--max_old_space_size=32384 ts-node ./ci/dev/watch.ts", "icons": "./ci/dev/gen_icons.sh", - "badges": "istanbul-badges-readme", "coverage": "codecov" }, "main": "out/node/entry.js", @@ -65,7 +64,6 @@ "eslint-plugin-import": "^2.18.2", "eslint-plugin-jest-playwright": "^0.2.1", "eslint-plugin-prettier": "^3.1.0", - "istanbul-badges-readme": "^1.2.0", "leaked-handles": "^5.2.0", "parcel-bundler": "^1.12.5", "prettier": "^2.2.1", From cb5997b513535464d4fdcb6291809f1392a9db39 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 26 Apr 2021 14:13:02 -0700 Subject: [PATCH 2/2] docs(readme): add codecov badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1dd184a25..d472c33f8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # code-server · [!["GitHub Discussions"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/cdr/code-server/discussions) [!["Join us on Slack"](https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen)](https://cdr.co/join-community) [![Twitter Follow](https://img.shields.io/twitter/follow/CoderHQ?label=%40CoderHQ&style=social)](https://twitter.com/coderhq) +[![codecov](https://codecov.io/gh/cdr/code-server/branch/main/graph/badge.svg?token=5iM9farjnC)](https://codecov.io/gh/cdr/code-server) [![See latest docs](https://img.shields.io/static/v1?label=Docs&message=see%20latest%20&color=blue)](https://github.com/cdr/code-server/tree/v3.9.3/docs) Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and access it in the browser.