Merge pull request #65 from nstelter-slac/precommit-dev-req #185
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with Python 3.8 | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI Status | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.8" | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 | |
pip install pytest-xvfb | |
pip install -r requirements.txt | |
pip install -r dev-requirements.txt | |
- name: Install packages for testing a pyqt app | |
run: | | |
sudo apt-get install libxcb-xinerama0 pyqt5-dev-tools | |
- name: Lint with flake8 | |
run: | | |
# 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. | |
flake8 . --count --exit-zero --max-line-length=120 --statistics | |
- name: Test with pytest | |
run: | | |
pytest --doctest-modules --junitxml=junit/test-results.xml --cov=slam --cov-report=xml --cov-report=html |