from-travis-to-github-actions

👨🏻‍🔧 ➡ 🤖

Stars
49

Moving from Travis to Github Actions

An attempt to create an "from/to" document and help people move from Travis to Github Actions.

Table Content

Travis to Github Actions Cookbook

Installing dependencies

Travis

install:
- pip install --upgrade pip pipenv
- pipenv sync --dev

Github Actions

jobs:
    build:
    steps:
    - name: Install dependencies
      run: |
        pip install --upgrade pip pipenv
        pipenv sync --dev

Specifying language and version

Travis

language: python
python:
- '3.6.8'

Github Actions

jobs:
    build:
    steps:
    - name: Set up Python 3.6.9
      uses: actions/setup-python@v1
      with:
        python-version: 3.6.9

Running specific branches

Travis

branches:
  only:
  - master

Github Actions

on:
  pull_request:
    branches:
    - master

Dist

Travis

dist: xenial

Github Actions

jobs:
    build:
        runs-on: ubuntu-latest

It's possible to test your library across a matrix of operating systems and runtime versions using matrix strategy on Github Actions.

Global environment variables

Not supported by GitHub Actions yet (see the discussion here).

A hack to make them global.

Services

Travis

services:
- redis-server

Github Actions

jobs:
    services:
        redis:
            image: redis
            ports:
            - 6379:6379

Interesting stuff

Contributing

Open your Pull Request using the following format:

Title

Travis

# Travis' sintaxe

Github Actions

# Github Actions' sintaxe
Related Projects