Skip to content

Commit

Permalink
feat: Replace Travis by Github actions (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
haidaraM committed Nov 3, 2020
1 parent a43250d commit e5fbe04
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 32 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Testing

on:
- push

jobs:
pytest:
name: Tests Py${{ matrix.python-version }} - Ansible ${{ matrix.ansible-version }}
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [ 3.7, 3.8 ]
ansible-version: [ 2.8.6, 2.9.0, 2.9.14 ]

steps:
- name: Checkout code
uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Setup Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}

- name: Install prereqs
run: |
pip install ansible==${{ matrix.ansible-version }} virtualenv setuptools wheel coveralls
pip install -r tests/requirements_tests.txt
sudo apt-get install -y graphviz
- name: Pytest
env:
PY_COLORS: "1"
run: make test

- name: Upload generated SVGs as artefacts
uses: actions/upload-artifact@v2
with:
name: generated-svgs-py${{ matrix.python-version }}-ansible${{ matrix.ansible-version }}
path: tests/generated_svg/
if-no-files-found: error # the tests should generate SVGs files

- name: Test installation in virtualenv
run: make test_install

- name: Upload Coverage
run: cd tests && coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: py${{ matrix.python-version }}-ansible${{ matrix.ansible-version }}
COVERALLS_PARALLEL: true

coveralls:
runs-on: ubuntu-20.04
name: Finish coverage
needs: pytest
container: python:3-slim # just need a simple python container to finish the coverage
steps:
- name: Coveralls finish
run: pip install coveralls && coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ansible Playbook Grapher

[![Build Status](https://travis-ci.org/haidaraM/ansible-playbook-grapher.svg?branch=master)](https://travis-ci.org/haidaraM/ansible-playbook-grapher)
![Testing](https://github.com/haidaraM/ansible-playbook-grapher/workflows/Testing/badge.svg)
[![PyPI version](https://badge.fury.io/py/ansible-playbook-grapher.svg)](https://badge.fury.io/py/ansible-playbook-grapher)
[![Coverage Status](https://coveralls.io/repos/github/haidaraM/ansible-playbook-grapher/badge.svg?branch=master)](https://coveralls.io/github/haidaraM/ansible-playbook-grapher?branch=master)

Expand Down

0 comments on commit e5fbe04

Please sign in to comment.