GitHub Actions are Free

One of my teammates made a very nice CI/CD pipeline for us in GitHub for our capstone project. During the last few weeks, I ran into an issue where some of the test cases would run for me on my local machine but not in the pipeline. In the end, it turned out to be something to do with the path to an sqlite database being different when imported between two python projects and inside of virtual environments. I still don’t know for sure what the problem was, but the short answer is that we solved the problem by just using an environmental variable to the absolute path.

While trying to debug the pipeline, I ended up pushing at least a dozen commits, each which caused the pipeline to run. My teammate was clever and used some caching to speed up the process; nevertheless, it got me wondering about how much it was costing to use the service. I asked my other teammate how much GitHub actions cost and he informed me that they were free. For some reason I had it in my mind that we only had a limited number of minutes for the pipelines and the free part had to do with being students and having a pro account. This turned out to be false. After some googling I discovered that some time ago GitHub actions were made free for all public repos. I was living in some alternate universe.

I immediately looked through some of my personal GitHub projects and tried to see where I could exploit this new free feature. I set up a pipeline to run unit tests for my incremental backups project (https://github.com/erietz/incremental-backups). The template that GitHub provides for python projects includes the ability to run your tests using multiple different versions of python in parallel. I quickly discovered that my code failed on python 3.8 while it passed on 3.9 and 3.10. On my personal machine I think I had 3.9 so I never would have discovered the issue without the pipeline.

I then got to thinking that I could create a pipeline for my machine setup repo (https://github.com/erietz/machine-setup). In this repo I use Ansible to clone my dotfiles (https://github.com/erietz/.dotfiles), install a bunch of software that I depend on, and run some install scripts to prepare a system how I like it. Since I have dotfiles for Manjaro, Ubuntu, and macos, this turned out to be more work to get everything working correctly. My most used operating system is Manjaro and it is slightly disappointing to see that the only Linux OS available as a runner for the pipeline in GitHub is Ubuntu. For the Manjaro workflow, I run the entire thing in a docker container on the Ubuntu host.

In an ideal world, the code required to configure a Manjaro machine versus an Ubuntu machine would be practically identical. However, many of the packages between the two systems have different names and there are other quirks which make the Ansible roles different enough that I can’t find a way to reuse the code. I favor simplicity over complexity and having to configure three different types of machines leads me to want to abandon Manjaro and switch completely over to Debian based distributions. In this way, I could run my Ansible playbooks directly on the machine in GitHub and keep things simple.

Those System 76 laptops look pretty slick and they come with Pop OS 🙂