Find Perl 6 modules without Travis CI

Travis-CI is a service that offers Continuous Integration to open source project hosted on GitHub free of charge. It supports a number of languages, including several versions of Perl 5, and Perl 6.

There are plenty of Perl 6 modules hosted on GitHub. Some of them already use Travis-CI, others not yet. In this article we'll write a Perl 6 script that will find the repositories without a .travis.yml.

It would be helpful if all the other Perl 6 projects start using Travis-CI as well.

Note! This site is about Perl 6.
If you are looking for a solution for the current production version of Perl 5, please check out the Perl 5 tutorial.


use v6;

use LWP::Simple;

my $html = LWP::Simple.get('');

my $urls = 0;
my $missing = 0;
for $html.split(/\n/) -> $line {
	# Capturing ttps://
	if $line ~~ /\"(https\:\/\/\/<[\w\-]>+\/<[\w\-]>+)\/?\"/ {
		my $url = $0;
		# Creating
		my $travis_yml_url = "$url/blob/master/.travis.yml";
		#say $travis_yml_url;

		# my $travis_yml_html = LWP::Simple.get($travis_yml_url);
		# say $travis_yml_html
		# did not work:
		my $proc = run 'curl', '-s', $travis_yml_url, :out;
		my $out = $proc.out.slurp-rest;
		if $out eq '{"error":"Not Found"}' {
			say "Missing Travis.yml $url";
say "Total: $urls  Missing: $missing";

The first thing is to use the get method of LWP::Simple to fetch the web page listing the Perl 6 modules.

Then we go over line-by-line and use a regular expression to locate all the URLs that lead to GitHub projects. It might be better to use an HTML Parser, for example HTML::Parser::XML, but I found the regex solution simpler.

Then for each GitHub repository we try to download the .travis.yml file. I tried to use LWP::Simple for this, but there seems to be a bug that stopped me from doing that. The second best option was to use curl.

As of 2015.10.10, 311 out of 379 modules aren't using Travis-CI yet.

  1. If there is no .travis.yml in the repository, check if there is already a pull request adding it. Proceed only if you'll be the first one.
  2. Fork the repository on GitHub
  3. Go to your Travis-CI page, click on Your Name/Accounts and then on the Sync button.
  4. After the sync has finished, enable Travis-CI for the newly forked repository.
  5. Clone the forked repository to your local disk
  6. Make sure tests pass on your local system: prove -e "perl6 -Ilib"
  7. Add the .travis.yml file
  8. Use the example below (after updating the panda install list from the file from the repository, or follow the instructions for Perl 6 on Travis-CI
    1. git checkout -b travis
    2. git add .travis.yml
    3. git commit -m "add travis configuration file"
    4. git push --set-upstream origin travis
  9. .
  10. Wait for Travis-CI to run the test.
  11. Fix any issues that might arise. (I know this can be a very open-ended step.)
  12. Send a pull-request to the author.

    - gh-pages
sudo: false
language: perl6
  - latest
  - rakudobrew build-panda
  - panda installdeps .

The Perl 6 Tricks and Treats newsletter has been around for a while. If you are interested to get special notification when there is new content on this site, it is the best way to keep track:
Full name:
This is a newsletter temporarily running on my personal site ( using Mailman, till I implement an alternative system in Perl 6.
Gabor Szabo
Written by Gabor Szabo

Published on 2015-10-10


In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus
Suggest a change
Elapsed time: 3.7707883

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.