Add your modules
It's pretty simple to add yourself to the list of CPAN authors on our front page. Currently we only support code repos on Github and a limited number of CI services (but we plan to add support for more services in the future).
Here are the steps to follow:
- Add a link to the code repos to the metadata of all of your CPAN modules. (Gabor has a tutorial about that.)
- Decide which of the supported CI services you want to use and configure them correctly. (More details on the various services below.)
- Take a fork of the CPAN Dashboard repo.
- Add a file in the authors directory. Copy this file and name the new file using your CPAN author name.
- Update the file to contain the correct information about your CPAN and Github usenames and the CI services that you use. Switch the various ci.use_XXX flags to 0 for services that you don't use.
- Send a pull request adding your file to my repo.
- Sit back and wait for me to merge your PR.
Supported CI services
We currently support the following CI services:
Github Actions can do many things. But we're just using it to run tests on each commit and report on the success or failure of the test run. Add a directory called .github/workflows to your code repository and in that directory create a YAML file that runs the processes that you want to run. A basic workflow file for testing a CPAN module might look something like this.
You can track as many Github Actions as you like and the badges will stack on top of each other in your dashboard (this isn't currently as pretty as I'd like it, but we're working on it). Remember the values of the name keys in your YAML files as you'll need to add those to the ci.gh_workflow_names option in your new configuration file. We currently expect all of your modules to run the same set of Github Actions.
To add your repos to Travis CI, you need to set up an account there. You can log in using your Github credentials. Then sync your repos and switch on the ones that you want Travis CI to work with.
You'll then need to add a .travis.yml file to your CPAN repos. Travis CI has a guide to doing that. Having done this, the next time you commit to the repo, you'll get a test run on the Travis CI site.
Note that we support both the .org and .com versions of Travis CI. The author configuration file has a use_travis key (for .org) and a use_travis_com key (for .com).
Coveralls.io measures your test coverage. Adding your repos here is a lot like adding them to Travis CI. Log in with your Github credentials and turn on the repos that you want to use. You also have too add these lines to your .travis.yml file:
before_install: cpanm -n Devel::Cover::Report::Coveralls Module::Build script: perl Build.PL && ./Build build && cover -test -report coveralls
Next time you commit something to one of your repos, you will also get coverage information appearing at Coveralls.io.
Kritika.io is a service that measures code quality. For Perl code, it will run it through perlcritic.
Adding your repos here is simpler than the other services. You just set up an account (again, using your Github credentials) and then select which repos you want to use the service on. There's nothing at all to do in the repo. It will all just start to work the next time you make a commit.