From 32ee9490fa2ff0142aec7b0bd454eeba38679a66 Mon Sep 17 00:00:00 2001 From: Yauhen Yavorski Date: Thu, 25 Apr 2024 18:45:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Update=20pylint.yml=20to=20test?= =?UTF-8?q?=20and=20split=20the=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pylint.yml | 37 ++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index d4444a9..4f198d6 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,16 +1,16 @@ -name: Pylint +name: Python CI on: [push, workflow_dispatch] jobs: - build: + install-dependencies: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10", "3.11"] + outputs: + python-version: ${{ steps.setup-python.outputs.python-version }} steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python + id: setup-python uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} @@ -19,6 +19,27 @@ jobs: python -m pip install --upgrade pip pip install -U pylint pip install -r requirements.txt + + lint: + needs: install-dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ needs.install-dependencies.outputs.python-version }} - name: Analysing the code with pylint - run: | - pylint $(git ls-files '*.py') + run: pylint $(git ls-files '*.py') + + test: + needs: install-dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ needs.install-dependencies.outputs.python-version }} + - name: Run tests with pytest + run: pytest .