Skip to content

Test PIconnect

Test PIconnect #400

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Test PIconnect
on:
push:
branches: [develop, master]
pull_request:
# The branches below must be a subset of the branches above
branches: [develop, master]
schedule:
- cron: "27 19 * * 3"
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [
'3.8'
, '3.9'
, '3.10'
# , '3.11'
]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest wheel
python -m pip install pytest-cov
python -m pip install --exists-action=w --no-cache-dir -r requirements_dev.txt
python -m pip install .
- 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. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
check_format:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install black
- name: Check formatting with black
run: |
# stop the build if there are Python syntax errors or undefined names
black --check --diff PIconnect
# codacy-security-scan:
# name: Codacy Security Scan
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Run Codacy Analysis CLI
# uses: codacy/codacy-analysis-cli-action@master
# with:
# output: results.sarif
# format: sarif
# # Adjust severity of non-security issues
# gh-code-scanning-compat: true
# # Force 0 exit code to allow SARIF file generation
# # This will hand over control about PR rejection to the GitHub side
# max-allowed-issues: 2147483647
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# # or
# # api-token: ${{ secrets.CODACY_API_TOKEN }}
# upload: true
# # Upload the SARIF file generated in the previous step
# - name: Upload SARIF results file
# uses: github/codeql-action/upload-sarif@main
# with:
# sarif_file: results.sarif