Add analyze segment - thanks to @ksunden
This commit is contained in:
parent
fcb387c86e
commit
cc6a4d200c
55
.github/workflows/codeql-analysis.yml
vendored
Normal file
55
.github/workflows/codeql-analysis.yml
vendored
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
name: analyze pyqtgraph
|
||||||
|
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
# We must fetch at least the immediate parents so that if this is
|
||||||
|
# a pull request then we can checkout the head.
|
||||||
|
fetch-depth: 2
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: '3.9'
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install PyQt5 numpy scipy six
|
||||||
|
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: 'python'
|
||||||
|
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
queries: +security-and-quality
|
||||||
|
setup-python-dependencies: false
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
42
.github/workflows/main.yml
vendored
42
.github/workflows/main.yml
vendored
|
@ -1,9 +1,9 @@
|
||||||
name: test pyqtgraph
|
name: test pyqtgraph
|
||||||
|
|
||||||
on: [push]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -82,41 +82,54 @@ jobs:
|
||||||
if: runner.os != 'Linux'
|
if: runner.os != 'Linux'
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
|
mkdir $SCREENSHOT_DIR
|
||||||
pytest . -v \
|
pytest . -v \
|
||||||
-n auto \
|
-n auto \
|
||||||
--junitxml=junit/test-results.xml \
|
--junitxml=junit/test-results.xml \
|
||||||
--cov pyqtgraph --cov-report=xml --cov-report=html
|
--cov pyqtgraph --cov-report=xml --cov-report=html
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
- name: Upload Screenshots
|
||||||
AZURE: 1
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: Screenshots (Python ${{ matrix.python-version }} - Qt-Bindings ${{ matrix.qt-lib }} - OS ${{ matrix.os }})
|
||||||
|
path: $SCREENSHOT_DIR
|
||||||
|
if-no-files-found: ignore
|
||||||
- name: Upload Unit Test Results
|
- name: Upload Unit Test Results
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Unit Test Results (Python ${{ matrix.python-version }} - Qt-Bindings ${{ matrix.qt-lib }} - OS ${{ matrix.os }})
|
name: Unit Test Results (Python ${{ matrix.python-version }} - Qt-Bindings ${{ matrix.qt-lib }} - OS ${{ matrix.os }})
|
||||||
path: junit/test-results.xml
|
path: junit/test-results.xml
|
||||||
|
env:
|
||||||
|
SCREENSHOT_DIR: ./screenshots
|
||||||
|
|
||||||
build-docs:
|
build-docs:
|
||||||
# Name the Job
|
name: build docs
|
||||||
name: Build Docs
|
|
||||||
# Set the type of machine to run on
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checks out a copy of your repository on the ubuntu-latest machine
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Setup Python 3.9
|
- name: Setup Python 3.9
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
- name: Build Docs
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
cd doc
|
cd doc
|
||||||
python -m pip install -r requirements.txt
|
python -m pip install -r requirements.txt
|
||||||
|
- name: Build Documentation
|
||||||
|
run: |
|
||||||
|
cd doc
|
||||||
make html SPHINXOPTS='-W -v'
|
make html SPHINXOPTS='-W -v'
|
||||||
|
- name: Upload Build Docs
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: html-docs
|
||||||
|
path: |
|
||||||
|
doc/build/html
|
||||||
|
|
||||||
linting:
|
linting:
|
||||||
name: Linting
|
name: check linting
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -124,14 +137,15 @@ jobs:
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
# Runs the Super-Linter action
|
- name: "Install Dependencies"
|
||||||
- name: Style check
|
|
||||||
run: |
|
run: |
|
||||||
pip install flake8
|
pip install flake8
|
||||||
|
- name: "Check Linting"
|
||||||
|
run: |
|
||||||
python -m flake8 .
|
python -m flake8 .
|
||||||
|
|
||||||
build-wheel:
|
build-wheel:
|
||||||
name: Build Wheel
|
name: build wheel
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -149,4 +163,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: wheel
|
name: wheel
|
||||||
path: |
|
path: |
|
||||||
dist
|
dist
|
||||||
|
|
|
@ -212,7 +212,7 @@ def assertImageApproved(image, standardFile, message=None, **kwargs):
|
||||||
else:
|
else:
|
||||||
if os.getenv('TRAVIS') is not None:
|
if os.getenv('TRAVIS') is not None:
|
||||||
saveFailedTest(image, stdImage, standardFile, upload=True)
|
saveFailedTest(image, stdImage, standardFile, upload=True)
|
||||||
elif os.getenv('AZURE') is not None:
|
elif os.getenv('CI') is not None:
|
||||||
standardFile = os.path.join(os.getenv("SCREENSHOT_DIR", "screenshots"), standardFile)
|
standardFile = os.path.join(os.getenv("SCREENSHOT_DIR", "screenshots"), standardFile)
|
||||||
saveFailedTest(image, stdImage, standardFile)
|
saveFailedTest(image, stdImage, standardFile)
|
||||||
print(graphstate)
|
print(graphstate)
|
||||||
|
@ -509,7 +509,7 @@ def getTestDataRepo():
|
||||||
if not os.path.isdir(parentPath):
|
if not os.path.isdir(parentPath):
|
||||||
os.makedirs(parentPath)
|
os.makedirs(parentPath)
|
||||||
|
|
||||||
if os.getenv('TRAVIS') is not None or os.getenv('AZURE') is not None:
|
if os.getenv('TRAVIS') is not None or os.getenv('CI') is not None:
|
||||||
# Create a shallow clone of the test-data repository (to avoid
|
# Create a shallow clone of the test-data repository (to avoid
|
||||||
# downloading more data than is necessary)
|
# downloading more data than is necessary)
|
||||||
os.makedirs(dataPath)
|
os.makedirs(dataPath)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user