Skip to content

docs(readme): refactor to use codecov shield #3227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +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)

![Lines](https://img.shields.io/badge/Coverage-51.47%25-green.svg)
[![codecov](https://codecov.io/gh/cdr/code-server/branch/main/graph/badge.svg?token=5iM9farjnC)](https://codecov.io/gh/cdr/code-server)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown provided by Codecov. Don't worry, this token isn't used for uploading coverage data to Codecov. I believe it's just used for the badge.

[![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.
Expand Down
14 changes: 0 additions & 14 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 0 additions & 12 deletions ci/build/release-prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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"

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down