In my previous post, I discussed the differences between GitHub Actions vs CircleCI. In earlier posts, I have also compared Travis CI vs CircleCI, Travis CI vs Jenkins, and CircleCI vs Jenkins. This post includes what is arguably the most popular newcomer to the group of CI/CD service providers, GitHub Actions. Do you know which is better for your needs? Let’s compare the two platforms and lay out the differences between each, and provide a list of what I believe are the pros and cons of each. Let’s get started!
GitHub ActionsThis is an awesome new player in the CI/CD pipeline space provided by GitHub. They have been around for a long time and are also the most popular SCM provider in the world. GitHub offers great features and a great user experience for their SCM offerings.
GitHub Actions recently joined the CI/CD pipeline space back in November 2019. It was an instant hit among many companies and people that were already using the platform. This allowed for easier integration with code already hosted on GitHub, as well as the option to reduce the number of services you need to subscribe to or purchase to have a complete CI/CD workflow. This is obviously a great feature. It also allows for much easier viewing of the pipeline status for each build since you do not have to leave GitHub’s website to see any logs and/or errors; the tab is right there as part of your repository’s UI.
Features
You can utilize containers or VMs in your builds and also run on either GitHub.com or on-prem.
Use your own VMs, in the cloud or on-prem, with self-hosted runners.
There is support for the most popular programming languages today. These include Node.js, Python, Java, Ruby, PHP, Go, Rust, .NET, and more.
Just like Travis CI, GitHub Actions is also available to build on Linux, macOS, and Windows.
One great feature is the catalog of community-provided Actions you can add to your workflow without re-inventing the wheel. Don’t waste your precious time doing something that someone else has already done! Wondering if someone has already created the action you need in your workflow? Check out the catalog of available Actions here.
Build Matrix is another great available feature. This allows you to run multiple builds or tests simultaneously using different language versions, platform versions, etc. This can save quite a bit of time and also allow you to see if any certain language versions or platforms break with your new changes. For more information on creating a build matrix and what it can help with, check out this article.
Configuration
The configuration of GitHub Actions is very similar to that of CircleCI. You create a .github/workflows directory and create YAML files inside that directory. You can create different YAML files for each job or add them all to a single file if you wish. For a full list of available references that you can add to your config files, check out the reference guide. For a simple example of how to set up a configuration file, check out our example here.
Pricing
The pricing structure is based on paying for the amount of time your CI/CD pipelines are running per billing period. You get ~2K action minutes per month for free. Whereas Travis CI offers unlimited builds for their payment plans, they do not, however, offer a free tier except for open source projects (i.e. public repositories).
Travis CITravis CI is the oldest and most mature cloud-hosted CI/CD provider. It was founded in 2011 and is based in Berlin, Germany. Travis CI is among the most popular CI/CD platforms for open source projects. It has support for a variety of languages with multiple pricing plans available to suit most peoples’ needs. Travis CI is currently only available for GitHub and BitBucket.
Configuration
Travis CI can be configured as easily as just creating a file in the root of your SCM repo called .travis.yml
. You can find how to configure this file and all the available options here.
This allows for the ability to copy the configuration file to multiple
repositories and just edit the relevant details specific to that repo
and everything will work.
Some CI/CD tools require setting up the process manually to start with, and each time you create another project, you have to go through those same steps to set it up each time. Some steps could be overlooked or missed from time to time, which is not ideal. This can cause some of your automated processes to not work correctly, and thus possibly cause issues down the road if it goes unnoticed.
You can find steps to set up Travis CI with GitHub here. Steps to set up Travis CI with BitBucket are found here.
Pricing
Travis
CI is always free for open-source projects. For projects with private
repositories, there is a free tier that offers 10K credits that once
used up, you are unable to run any more builds for private repositories.
This 10K credit allotment will allow for an estimated 1000 minutes of
build time.
For unlimited builds for private repos that run on Windows, Linux, or FreeBSD, their pricing starts at $69/month for 1 concurrent build. For each paid plan, macOS builds now require an extra add-on of renewable credits. This means you no longer have unlimited macOS builds included in Travis CI’s paid plans. However, if you do not have any builds requiring macOS builds, or you have a limited amount of macOS builds, this may not be a huge change in pricing as $15 will get you @5K credits which will allow for roughly 500 macOS build minutes. See all details for pricing plans here.
Supported Languages
Travis CI supports a wide variety of programming languages. Currently, they support 32 different languages that are listed here and here. You can find docs for how to submit support for a new language here.
ComparisionGitHub Actions Pros
- One interface for both your source code repositories and your CI/CD pipelines
- Only 1 bill to pay that includes both your SCM plan and your CI/CD service (if you pay for either now that is)
- Build Matrix
- Catalog of available Actions you can utilize without reinventing the wheel
- Includes macOS builds as part of the free tier (macOS builds require 10 credits per build minute however compared to 1 credit per minute for Linux)
- Free tier credits are renewed/reset each month
GitHub Actions Cons
- Newer platform. Thus not as quite many features as Travis CI as of yet (although they sure have had a strong start)
- Only available for project repositories hosted on GitHub or GitHub Enterprise
Travis CI Pros
- Build Matrix
- Has a free tier (although not as many free build minutes). Private repo credits do not renew. However open-source projects are always free
- More widely used and thus more community-based support
- Can be hooked up to more SCMs than GitHub or GitHub Enterprise
Travis CI Cons
- Free tier credits do not renew every month
- Not as many available plugins to help ease the configuration of actions others have already completed
- Need multiple subscriptions for both SCM and CI/CD services
- Switching back and forth between CircleCI and SCM to see build logs and errors
The best platform for you all depends on your specific needs. If you host your code somewhere other than GitHub.com or GitHub Enterprise, you will be better off using Travis CI. However, if you host your code on GitHub.com or GitHub Enterprise, the choice can be a little more difficult.
For most people, if they have a small number of projects whose CI/CD config files are relatively simple, I would suggest giving GitHub Actions a try. Don’t disconnect or delete your current pipelines until you try GA out for a project or two, however. Just add the config files in for GA and see how you like the flow and feel of it. Once you verify that GA has everything you need to do your builds properly and successfully, and they have been running for at least a week or two successfully, you can delete your other config files and cancel your previous CI/CD service.
If you are interested in any other CI/CD platforms and are curious about the differences in all of them, go check out my posts comparing GitHub Actions vs CircleCI, Travis CI vs CircleCI, Travis CI vs Jenkins, and CircleCI vs Jenkins.
from https://devopsauthority.tech/2021/02/09/which-is-better-github-actions-travis-ci/
No comments:
Post a Comment