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

Run tests with Github Actions #1

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

on:
pull_request:
push:
branches:
- master
workflow_dispatch:
schedule:
# Run every Sunday at 03:53 UTC
- cron: 13 3 * * 0

jobs:
tests:
name: ${{ matrix.os }}, ${{ matrix.tox_env }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
python-version: '3.7'
tox_env: 'py37'
- os: ubuntu-latest
python-version: '3.8'
tox_env: 'py38'
- os: ubuntu-latest
python-version: '3.9'
tox_env: 'py39'
- os: ubuntu-latest
python-version: '3.10'
tox_env: 'py310'

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Tox
run: python -m pip install tox coverage
- name: Run Tox
run: tox -e ${{ matrix.tox_env }}
- name: Convert coverage
run: python -m coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[tox]
envlist = {py37,py38,py39,py310}{,-mpdafdev},docs
skip_missing_interpreters = true
isolated_build = true

[testenv]
whitelist_externals = which
Expand Down