88 lines
2.5 KiB
YAML
88 lines
2.5 KiB
YAML
# Workflow for python
|
|
name: ConaIsa
|
|
|
|
# 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
|
|
for file in $(git --no-pager diff --name-only origin/master | grep -o ".*\.py") ;do pytest "$file";done
|
|
# 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 |