CI - Continuous Integration
A Continuous Integration system (aka CI) can shorten the feedback cycle you get for your code.
Usually it will run your unit-tests, (or whatever you tell it to run) every time you push code to your VCS - Version Control System. (GitHub, GitLab, BitBucket, or even Subversion.) It can run it on multiple versions of Perl on the 3 major Operating Systems.
It can run on every Pull-Request so both your contributor and you will know the offered change does not break the code almost immediately.
You can configure it to run the tests of some of the modules that depend on your code to verify that your changes don't break any of the downstream dependencies. Consider this as integration-tests.
It can go further and run your tests even if you have not made any change to verify that changes in the modules your code depends on did not break your code.
Why do I need a CI if I run my tests before releasing my module to CPAN?
- It can identify problems much earlier.
- It will help you ensure that other people can also easily build your project.
- It can catch issues as simple as forgeting to include a file or relying on some local configuration you long forgot about.
Avialable CI systems
- GitHub Actions is the integrated CI system GitHub offers.
- Travis-CI is an independent company offering CI system for GitHub repositories.
- Appveyor
- CircleCI
- Azure Pipelines
- GitLab Pipelines
- BitBucket Pipelines
CI for CPAN mini-series
The goal of this mini-series is to get to the point where all the CPAN modules that use GitHub for version control have a CI system configured.
- What is Continuous Integration (CI) and why is it useful?
- What is the difference between the CI systems mentioned above and the CPAN Testers
- What Cloud-based CI systems are available for GitHub users? GitHub Actions, Travis-CI, Appveyor, CircleCI, Azure Pipelines
- Why use GitHub Actions?
- What is Travis-CI and how to set it up? See the following articles:
- Travis-CI for the Markua Parser project (part of the Markua series)
- Enable Travis-CI for Continuous Integration (part of the Become a co-maintainer series)
- Using Travis-CI and installing Geo::IP on Linux and OSX
- We'll look at a few examples on how various Perl projects use GitHub Actions
- Setup GitHub Actions for a Perl module
- Run on Windows, MacOSX, Linux based on Array::Compare of Dave Cross
- Show the error logs of cpanm on Linux, MacOSX, or Windows
- Perl Power Tools of brian d foy
- GraphViz2 of Ron Savage and Ed J
- Docker Perl Tester by Nicolas R and Olaf Alders
- Maybe others
- We'll also take a look at the CPAN Dashboard Dave Cross has
- We'll see how to find a CPAN module that does not have CI yet. (Check out the CPAN::Digger project.)
- How to configure GitHub Actions
- How to send a pull-request
A nice collection of Tips for testing Perl modules via GitHub Actions by Felipe Gasper.
GitLab
Published on 2020-11-05