diff --git a/.github/workflows/pylint.yml b/.github/workflows/linting.yml similarity index 87% rename from .github/workflows/pylint.yml rename to .github/workflows/linting.yml index 194ef55..d394df6 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/linting.yml @@ -1,13 +1,16 @@ -name: Pylint +name: Linting and testing on: push: + branches: + - main paths: - - 'taky/**' + - 'taky/**' + pull_request: workflow_dispatch: jobs: - build: + lint-and-test: runs-on: ubuntu-latest outputs: @@ -15,12 +18,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 +44,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 +53,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