2020-02-10 16:14:58 +01:00
|
|
|
# Workflow for python
|
2020-02-10 17:08:57 +01:00
|
|
|
name: ConaIsa
|
2020-02-10 16:14:58 +01:00
|
|
|
|
|
|
|
# Relevant to events - https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [synchronize, opened, reopened, ready_for_review]
|
|
|
|
paths:
|
|
|
|
- '**.py'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# Linting
|
|
|
|
lint-python:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install -r requirements.txt
|
|
|
|
- name: Lint with flake8
|
|
|
|
run: |
|
|
|
|
pip install flake8
|
|
|
|
# stop the build if there are Python syntax errors or undefined names
|
|
|
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
|
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
|
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
|
|
|
pip install pytest
|
2020-02-10 16:36:34 +01:00
|
|
|
for file in $(git --no-pager diff --name-only origin/master | grep -o ".*\.py") ;do pytest "$file";done
|
2020-02-10 16:14:58 +01:00
|
|
|
# Kernel specific builds
|
|
|
|
build-python:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: building..
|
|
|
|
run: make build-python
|
|
|
|
|
|
|
|
# Docker builds
|
|
|
|
build-python-debian:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: docker://debian/testing:latest
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: building..
|
|
|
|
run: make build-python
|
|
|
|
|
|
|
|
build-python-fedora:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: docker://fedora/latest:latest
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: building..
|
|
|
|
run: make build-python
|
|
|
|
|
|
|
|
# Run tests
|
|
|
|
check-python:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: running tests..
|
|
|
|
run: make check-python
|
|
|
|
|
|
|
|
# Benchmarks
|
|
|
|
bench-python:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: running benchmarks..
|
|
|
|
run: make bench-python
|