Skip to content

Warn if sample is empty #18

Warn if sample is empty

Warn if sample is empty #18

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python tests
on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["pypy3.10", "3.10"] # Arbitrary pick of one pypy and one Cpython version
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup cache for apt packages (used by builddeb)
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: debhelper (>= 8.0.0) dh-python python3-pytest libboost-regex-dev
version: 1.0
- name: Install apt packages
run: apt-get install debhelper dh-python python3-pytest libboost-regex-dev
shell: bash
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
# Exclude examples as there is some python2 code there
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude examples/
# 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 --exclude examples/
- name: Build debian packages
run: make builddeb
- name: Test with pytest
run: pytest