Test PIconnect #534
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 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: | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [develop, master] | |
schedule: | |
- cron: "27 19 * * 3" | |
jobs: | |
lint_and_check_format: | |
name: Lint and Check Formatting | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install ruff | |
- name: Lint with ruff | |
run: | | |
ruff check . | |
- name: Check formatting with ruff | |
run: | | |
ruff format --check | |
run_tests: | |
name: Test with Python ${{ matrix.python-version }} | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ | |
'3.10' | |
, '3.11' | |
, '3.12' | |
] | |
needs: lint_and_check_format | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install 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: Test with pytest | |
run: | | |
pytest | |
# codacy-security-scan: | |
# name: Codacy Security Scan | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# - 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 |