Skip to content

My personal setup for Open Source projects on Github.

Notifications You must be signed in to change notification settings

itsdevdom/my-open-source-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

Open Source Project Starter

My personal setup for Open Source projects on Github.



GitHub Labels

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.

GitHub Labels Preview

Setup

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.

  1. Install GitHub Label Template globally by running:
npm install -g github-label-template
  1. 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_repo must be enabled) with a meaningful title, hit Generate Token, and copy the result.

  2. Now, clear all existing labels by running:

ghlbl -o <GITHUB_USER_NAME> -r <GITHUB_REPO_NAME> -t <GITHUB_TOKEN> -d
  1. Then, import the label template by running:
ghlbl -o <GITHUB_USER_NAME> -r <GITHUB_REPO_NAME> -t <GITHUB_TOKEN> -i ./presets/github-labels.json




Codecov 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.

Codecov Preview

I've also tested Coveralls, but it wasn't very stable in my experience.

Setup

  1. Add the codecov to the devDependencies of your project's package.json file. For example:
{
  "devDependencies": {
    "codecov": "x.x.x"
  }
}
  1. Add a code coverage upload script to your package.json file. For example:
{
  "test:upload-coverage": "codecov -f coverage/coverage-final.json"
}
  1. Add a codecov.yml configuration file to your project with your preferred configuration.

My custom configuration can be found at presets/codecov.yml.

  1. 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

About

My personal setup for Open Source projects on Github.

Topics

Resources

Stars

Watchers

Forks