Skip to content

Commit

Permalink
Merge main into cdrhook_server_update
Browse files Browse the repository at this point in the history
  • Loading branch information
abodeuis committed Jul 16, 2024
2 parents 8c44db6 + 288c7fb commit 5df6aca
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Pylint

on: [push]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
lint-directories: ["./cdrhook", "./tests", "./uploader", "./monitor"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ${{ matrix.lint-directories }} --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ${{ matrix.lint-directories }} --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
16 changes: 3 additions & 13 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
lint-directories: ["./cdrhook", "./tests", "./uploader", "./monitor"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -30,17 +29,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f cdrhook/requirements.txt ]; then pip install -r cdrhook/requirements.txt; fi
- name: Setup Env
run: |
echo "CDR_TOKEN=${{ secrets.CDR_TOKEN }}" >> $GITHUB_ENV
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ${{ matrix.lint-directories }} --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ${{ matrix.lint-directories }} --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest tests

0 comments on commit 5df6aca

Please sign in to comment.