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

Add CI to run tests on pull requests #150

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
68 changes: 68 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Tests

on:
push:
branches:
- master
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only on the master branch?

pull_request: ~

jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: [""3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]


steps:
- uses: actions/checkout@master
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/checkout@master
- uses: actions/checkout@v4


- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/setup-python@v2
uses: actions/setup-python@v5

with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: pip install pytest requests

- name: Tests
run: pytest

docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/checkout@master
- uses: actions/checkout@v4


- name: Set up Python 3.10
uses: actions/setup-python@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/setup-python@v2
uses: actions/setup-python@v5

with:
python-version: "3.10"

- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme
pip install .

- name: Build docs
run: |
cd docs
sphinx-build -qb html -d /tmp/doctrees . /tmp/html

coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/checkout@master
- uses: actions/checkout@v4


- name: Set up Python 3.10
uses: actions/setup-python@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/setup-python@v2
uses: actions/setup-python@v5

with:
python-version: "3.10"

- name: Install dependencies
run: pip install pytest pytest-cov coveralls

- name: Test
run: pytest -qq --cov=fritzconnection --cov-report=term-missing