If you follow my blog you are aware that I use automated tools to do some boring tasks instead of me. For example they can detect when new versions of dependencies I’m using are available and then schedule testing against them on the fly.

Recently I’ve made a slightly different proof-of-concept for a Rust project. Because rustc and various dependencies (called crates) are updated very often we didn’t want to expand the test matrix like Strazar does. Instead we wanted to always build & test against the latest crates versions and if that passes create a pull request for the update (in Cargo.lock). All of this unattended of course!

To start create a cron job in Travis CI which will execute once per day and call your test script. The script looks like this:

The script doesn’t force push, but in practice that may be useful (e.g. updating the PR);

The script doesn’t have any error handling;

If PR is still open GitHub will tell us about it but we ignore the result here;

DON’T paste this into your Makefile because the GITHUB_TOKEN variable will be expanded into the logs and your secrets go away! Always call the script from yourMakefile to avoid revealing secrets.

I am using topic branches because this is a POC. Switch to master and maybe move all URLs as variables at the top of the script!

I run this cron build against a fork of the project because the team doesn’t feel comfortable having automated commits/pushes. I also create the pull requests against my own fork. You will have to adjust the targets if you want your PR to go to the original repository.