In GitHub, we can assign labels to both issues and pull requests in order to signify their priority, category, or just assign any other
useful information. This makes understanding and organizing issues much easier, especially for bigger projects. This repository comes with a
basic label preset, placed within the github-labels.json file.
The following describes how to quickly setup my personal list of labels.
WARNING:
This process clears all existing labels, thus also unassigning labels from all issues and pull requests! For existing projects, it's better to just create / update / delete the labels manually.
- Install GitHub Label Template globally by running:
npm install -g github-label-template-
Using this tool requires a GitHub access token. To generate one, visit the GitHub Personal Access Tokens page, generate a new token (at least
repo -> public_repomust be enabled) with a meaningful title, hit Generate Token, and copy the result. -
Now, clear all existing labels by running:
ghlbl -o <GITHUB_USER_NAME> -r <GITHUB_REPO_NAME> -t <GITHUB_TOKEN> -d- Then, import the label template by running:
ghlbl -o <GITHUB_USER_NAME> -r <GITHUB_REPO_NAME> -t <GITHUB_TOKEN> -i ./presets/github-labels.jsonCodecov allows us to track code coverage over time, and it also comes with a bot that writes comments into Pull Requests presenting the current code coverage and its change compared to the default branch.
I've also tested Coveralls, but it wasn't very stable in my experience.
- Add the codecov to the
devDependenciesof your project'spackage.jsonfile. For example:
{
"devDependencies": {
"codecov": "x.x.x"
}
}- Add a code coverage upload script to your
package.jsonfile. For example:
{
"test:upload-coverage": "codecov -f coverage/coverage-final.json"
}- Add a
codecov.ymlconfiguration file to your project with your preferred configuration.
My custom configuration can be found at
presets/codecov.yml.
- Run the script to your CI, after your tests have finished successfully. In GitHub actions, for example:
jobs:
test:
name: Test
steps:
# Other steps ...
- name: Upload test coverage
run: npm run test:upload-coverage
