Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 41 additions & 21 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,51 @@ on:
pull_request:
branches:
- main
push:
branches:
- dev

jobs:
build:
pylint:
name: pylint
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
strategy:
matrix:
python-version: ["3.11"]
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
pip install pylint pylint-junit
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --exit-zero \
--reports=y \
--output-format=junit-xml:pylint.xml
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- uses: dciborow/action-pylint@0.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
glob_pattern: "**/*.py"
pylint_rc: .pylintrc
reporter: github-pr-review
level: warning

# - name: Generate pylint JUnit report
# run: |
# FILES=$(git ls-files '*.py')
# if [ -n "$FILES" ]; then
# pylint $FILES --output-format=junit-xml:pylint.xml
# fi

- name: upload artifact
uses: actions/upload-artifact@v6
with:
name: pylint-report
path: pylint.xml
# - name: Upload artifact
# uses: actions/upload-artifact@v6
# with:
# name: pylint-report
# path: pylint.xml
12 changes: 5 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# 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: tests
name: Tests

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev", "tests/tests-new-enpoints-and-crud" ]
branches: [ "main", "dev" ]

permissions:
contents: read
Expand Down Expand Up @@ -42,11 +39,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov alembic
pip install pytest-cov
if [ -f orders_service/requirements-dev.txt ]; then pip install -r orders_service/requirements-dev.txt; fi

- name: Wait for Postgres
Expand All @@ -60,7 +58,7 @@ jobs:
# env:
# DATABASE_URL: postgresql://test:test@localhost:5432/test_db

- name: Integration tests with pytest
- name: Tests with pytest
run: |
mkdir -p logs
LOGFILE="logs/pytest-$(date +'%Y-%m-%d_%H%M%S').log"
Expand Down
Loading