September 25, 2020 at 20:13

I've been using Travis CI fairly extensively since 2013, when I moved my personal OSS projects from Bitbucket to GitHub. It's a great service and a much-appreciated boon to the open-source community.

However, since Travis announced that their .org variant is shutting down soon, I wanted to check out some of the alternatives, and GitHub actions (GHA) seemed very interesting.

So this week I've migrated pycparser and a few of my other OSS projects over to GHA. This turned out to be very easy! Here's a brief recap.

Workflow configuration To activate GHA for pycparser, all I had to do is create the following YAML file as .github/workflows/ci.yml in the repository: name: pycparser-tests on: push: branches: - master pull_request: branches: - master jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: python-version: [2.7, 3.6, 3.7, 3.8] os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Test run: | python tests/all_tests.py Some notes: This workflow fires on two kinds of events: pushes to the master branch and PRs to the master branch. Each PR will have an automatic CI run for each change (every new commit pushed).

It runs in multiple configurations: the cross-product of Python versions and OSes, as specified.

The run: entry is the command the runs the tests.

entry is the command the runs the tests. While pycparser doesn't have any dependencies, it's easy to have those too by adding pip install $whatever lines to run: before the actual test execution line. GitHub tests passed badge