From cb6522780ec6de038c090825c9ef77082a518a41 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Sun, 6 Oct 2024 23:39:44 +0200 Subject: [PATCH] added ruff mypy and tests to github workflow --- .github/workflows/lint-and-test.yml | 102 ++++++++++++++++++++++------ 1 file changed, 81 insertions(+), 21 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 4a32a57..d50d7d3 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -9,8 +9,7 @@ permissions: pull-requests: read jobs: - - isort: + ruff: runs-on: ubuntu-latest container: image: python:3.12 @@ -18,11 +17,11 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Install dependencies - run: pip install isort - - name: Check imports order - run: isort -c . + run: pip install ruff + - name: Check code errors + run: ruff check --output-format=github . - black: + mypy: runs-on: ubuntu-latest container: image: python:3.12 @@ -30,35 +29,96 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Install dependencies - run: pip install black - - name: Check code format - run: black --check --diff --color . + run: pip install mypy + - name: Check code errors + run: mypy amazon_paapi - flake8: + test-py35: runs-on: ubuntu-latest container: - image: python:3.12 + image: python:3.5 steps: - name: Check out code uses: actions/checkout@v4 - name: Install dependencies - run: pip install flake8 - - name: Check code errors - run: flake8 . + run: pip install -e . + - name: Run tests + run: unittest - pylint: + test-py36: runs-on: ubuntu-latest container: - image: python:3.12 + image: python:3.6 steps: - name: Check out code uses: actions/checkout@v4 - name: Install dependencies - run: pip install pylint - - name: Check code errors - run: find . -type f -name '*.py' | xargs pylint --disable=missing-docstring --disable=too-few-public-methods + run: pip install -e . + - name: Run tests + run: unittest + + test-py37: + runs-on: ubuntu-latest + container: + image: python:3.7 + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install dependencies + run: pip install -e . + - name: Run tests + run: unittest + + test-py38: + runs-on: ubuntu-latest + container: + image: python:3.8 + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install dependencies + run: pip install -e . + - name: Run tests + run: unittest + + test-py39: + runs-on: ubuntu-latest + container: + image: python:3.9 + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install dependencies + run: pip install -e . + - name: Run tests + run: unittest + + test-py310: + runs-on: ubuntu-latest + container: + image: python:3.10 + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install dependencies + run: pip install -e . + - name: Run tests + run: unittest + + test-py311: + runs-on: ubuntu-latest + container: + image: python:3.11 + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install dependencies + run: pip install -e . + - name: Run tests + run: unittest + - test: + test-py312: runs-on: ubuntu-latest container: image: python:3.12 @@ -77,7 +137,7 @@ jobs: sonar: runs-on: ubuntu-latest - needs: [test] + needs: [test-py312] steps: - name: Check out code uses: actions/checkout@v4