tests: Switch from Travis to GitHub Actions (faster)

Primary motivation for this is speed: GitHub Actions doesn't limit the
number of concurrent jobs to 4, and also provides a docker registry
(GitHub Packages) that we can use to cache the image (building the image
takes cca 5 minutes, fetching it would take less than 10 seconds). This
is done in another commit.

The workflow definition is a bit more complicated because coveralls
support for GitHub Actions is less mature than for Travis CI, so we need
to manually tell coveralls that all parallel builds have finished and
that it can publish the combined result.
This commit is contained in:
Tomas Janousek 2020-07-04 18:27:58 +02:00 committed by Tomas Babej
parent 3b72535707
commit 4e8b01e6e2
5 changed files with 47 additions and 24 deletions

36
.github/workflows/tests.yaml vendored Normal file
View file

@ -0,0 +1,36 @@
name: tests
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- TASK_VERSION: v2.4.0
- TASK_VERSION: v2.4.1
- TASK_VERSION: v2.4.2
- TASK_VERSION: v2.4.3
- TASK_VERSION: v2.4.4
- TASK_VERSION: v2.5.0
- TASK_VERSION: v2.5.1
continue-on-error: ${{ matrix.continue-on-error == true }}
steps:
- uses: actions/checkout@v2
- name: Prepare docker image
run: docker-compose build --build-arg TASK_VERSION=${{ matrix.TASK_VERSION }} tests
- name: Test
run: make test PYTEST_FLAGS="-n8"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
coveralls-finished:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Finished
uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true