From ec3ad6f2bcc8ee18d35071336edf0167e76cef4b Mon Sep 17 00:00:00 2001 From: Andrei Sosnin Date: Fri, 17 May 2024 14:22:09 +0300 Subject: [PATCH 1/2] Fix CI pylint execution and upgrade python used --- .github/workflows/pylint.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 194ef55..6dc59df 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - build: + lint-and-test: runs-on: ubuntu-latest outputs: @@ -15,12 +15,12 @@ jobs: cov-pct: ${{ steps.tests.outputs.cov-pct }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - id: setup-python - name: Set up Python 3.8 + name: Set up Python 3.11 uses: actions/setup-python@v1 with: - python-version: 3.8 + python-version: 3.11 - id: pip-cache name: Cache pip uses: actions/cache@v2 @@ -41,7 +41,7 @@ jobs: - id: pylint name: Analyzing the code with pylint run: | - python3 -c "from pylint.lint import Run; ret = Run(['taky'], do_exit=False); print('::set-output name=score::%.2f' % ret.linter.stats.global_note)" + python3 -c "from pylint.lint import Run; ret = Run(['taky']); print('::set-output name=score::%.2f' % ret.linter.stats.global_note)" - id: tests name: Running unit tests, generating coverage run: | @@ -50,7 +50,7 @@ jobs: echo "::set-output name=cov-pct::${COV_PCT}" badges: runs-on: ubuntu-latest - needs: build + needs: lint-and-test steps: - id: shieldsio-pylint name: Create the Pylint Badge From 7b22ae6bd7d3b210c9c513dbb73d71e6fc222ca6 Mon Sep 17 00:00:00 2001 From: Andrei Sosnin Date: Fri, 17 May 2024 14:24:50 +0300 Subject: [PATCH 2/2] Rename the workflow and run on PR --- .github/workflows/{pylint.yml => linting.yml} | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename .github/workflows/{pylint.yml => linting.yml} (96%) diff --git a/.github/workflows/pylint.yml b/.github/workflows/linting.yml similarity index 96% rename from .github/workflows/pylint.yml rename to .github/workflows/linting.yml index 6dc59df..d394df6 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/linting.yml @@ -1,9 +1,12 @@ -name: Pylint +name: Linting and testing on: push: + branches: + - main paths: - - 'taky/**' + - 'taky/**' + pull_request: workflow_dispatch: jobs: