Skip to content
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
62 changes: 62 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Tests

on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 6 * * *'

defaults:
run:
shell: bash

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# would need custom setup to install browser and xvfb
# - windows-2019
# - macos-latest
python:
- 3.7
- 3.8
- 3.9
- '3.10' # Needs quotes so YAML doesn't think it's 3.1
steps:
- name: Set up environment
uses: actions/checkout@v3
with:
submodules: true

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -e "."
pip install pytest pytest-cov
sudo apt-get install xvfb chromium-browser

- name: Run all tests
run: |
xvfb-run --auto-servernum --server-num=20 python -m pytest -s -v --cov=netwulf netwulf/tests/test_all.py

# TODO for enthusiast to add token to secrets and upload coverage
#- name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.xml
# flags: unittests
# # name: codecov-umbrella
# # yml: ./codecov.yml
# fail_ci_if_error: false