

The GitHub base image ( ubuntu-latest) includes Chrome set up for testing and a enough of a native build environment that you can immediately install native modules and get going. Note that I've skipped the Chrome & XVFB steps here entirely - we don't need them.
#GITHUB ACTIONS CODE#
Very clear and easy: every time code is pushed, check it out and use node 14 to install dependencies & run the tests. Steps : - uses : Install Node 14 - uses : actions/setup : node-version : 14 # Install & build & test: - run : npm ci github/workflows/ci.yml) matching the essential steps of the Travis config: That summarizes the options available, and with a little wrangling that quickly gets us to a basic workflow (which I've saved as. We'll start with GitHub's JavaScript action getting started guide.

Slightly different versions of Chrome or Node, leftover git-ignored files and build output, and other environment-specific details can cause havoc.īeing able to quickly reproduce the exact cloud build environment locally makes debugging those issues much less frustrating! Getting Started Yes, you can install and run tests on my machine normally, but especially with more complicated builds you'll quickly discover that that isn't a perfect match for the cloud build environment, and you'll occasionally hit remote failures that don't reproduce in your own environment. One other feature I'd really like, and which I'd strongly recommend for everybody, is the option to run an equivalent CI environment locally.

I want to build with a specific node version.sudo chmod 4755 /opt/google/chrome/chrome -sandbox I decided to start with the simplest Travis setup I had: the HTTP Toolkit UI repo.īefore_script : - sudo chown root /opt/google/chrome/chrome -sandbox In this post, I want to share how I converted my JavaScript (well, TypeScript) build from Travis to GitHub, so you can do the same. Unfortunately, I knew very little about GitHub actions, and I already had some Travis configuration that worked. I've been looking longingly at GitHub Actions builds on other projects for a little while, and I'd already seen lots of useful extensions in the marketplace of drop-in action steps that'd make my life much easier. Travis was having a particularly bad build backlog day, and HTTP Toolkit is entirely open source on GitHub already, so it's super convenient. Last week, I decided to bite the bullet, and start migrating. Travis has been popular for years though, there's still a lot of projects being built there, including many of HTTP Toolkit's own repos.
#GITHUB ACTIONS FREE#
GitHub Actions is modern, tightly integrated with the most popular code hosting platform in the world, flexible, fast, and free (for public repos). Travis has been the most popular place to build open-source code for a long time, but the world is moving on.
