Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Github actions #54

Merged
merged 18 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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