Skip to content

Merge pull request #101 from IloBe/snyk-fix-e57243dbfd8a88a12bafd95b1… #223

Merge pull request #101 from IloBe/snyk-fix-e57243dbfd8a88a12bafd95b1…

Merge pull request #101 from IloBe/snyk-fix-e57243dbfd8a88a12bafd95b1… #223

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest # Which OS this runs on
strategy:
matrix:
python-version: ["3.10.9"] # You can build against multiple Python versions
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} # Name of an action that sets up Python
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip # Upgrade pip to the latest version
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
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
# DVC iterative setup installation path is not working (Nov 2024), now happens via requirement.txt
# - name: DVC install # see: https://github.com/iterative/setup-dvc
# uses: iterative/setup-dvc@v1
# - name: DVC
# run: |
# # see: https://dvc.org/doc/user-guide/troubleshooting#missing-files,
# # no remote cloud service available yet
# dvc pull
- name: Test with pytest
run: |
# Final action: runs pytest for all tests in the ./tests dir
pytest ./tests/*.py -vv