Skip to content

Commit

Permalink
experimental pylint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
greeeen-dev committed Dec 12, 2024
1 parent ba71100 commit 990851d
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Pylint

on: [push, pull_request, workflow_call]
on: [push, pull_request]

jobs:
linux-optimized:
Expand Down
32 changes: 19 additions & 13 deletions .github/workflows/pylint_balanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
type: string
description: "The operating system to run the workflow on."
default: ubuntu-latest
branch:
type: string
description: "The branch to run the workflow on."
default: ${{ github.ref }}

jobs:
build-linux:
Expand All @@ -16,16 +20,18 @@ jobs:
matrix:
python-version: ["3.12"]
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 -r requirements_balanced.txt
pip install pylint
- name: Pylint analysis
run: |
pylint --enable-all-extensions --extension-pkg-allow-list=orjson,ujson --disable=R,C,W $(git ls-files '*.py')
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- 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 -r requirements_balanced.txt
pip install pylint
- name: Pylint analysis
run: |
pylint --enable-all-extensions --extension-pkg-allow-list=orjson,ujson --disable=R,C,W $(git ls-files '*.py')
6 changes: 6 additions & 0 deletions .github/workflows/pylint_optimized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
type: string
description: "The operating system to run the workflow on."
default: ubuntu-latest
branch:
type: string
description: "The branch to run the workflow on."
default: ${{ github.ref }}

jobs:
build:
Expand All @@ -17,6 +21,8 @@ jobs:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/pylint_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Pylint (for release workflow)

on:
workflow_call:
inputs:
branch:
type: string
description: "The branch to lint."
default: "main"

jobs:
linux-optimized:
name: "Linux (Optimized)"
uses: ./.github/workflows/pylint_optimized.yml
with:
os: ubuntu-latest
branch: ${{ inputs.branch }}

linux-balanced:
name: "Linux (Balanced)"
uses: ./.github/workflows/pylint_balanced.yml
with:
os: ubuntu-latest
branch: ${{ inputs.branch }}

linux-stable:
name: "Linux (Stable)"
uses: ./.github/workflows/pylint_stable.yml
with:
os: ubuntu-latest
branch: ${{ inputs.branch }}

windows-optimized:
name: "Windows (Optimized)"
uses: ./.github/workflows/pylint_optimized.yml
with:
os: windows-latest
branch: ${{ inputs.branch }}

windows-balanced:
name: "Windows (Balanced)"
uses: ./.github/workflows/pylint_balanced.yml
with:
os: windows-latest
branch: ${{ inputs.branch }}

windows-stable:
name: "Windows (Stable)"
uses: ./.github/workflows/pylint_stable.yml
with:
os: windows-latest
branch: ${{ inputs.branch }}
32 changes: 19 additions & 13 deletions .github/workflows/pylint_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
type: string
description: "The operating system to run the workflow on."
default: ubuntu-latest
branch:
type: string
description: "The branch to run the workflow on."
default: ${{ github.ref }}

jobs:
build-linux:
Expand All @@ -16,16 +20,18 @@ jobs:
matrix:
python-version: ["3.12", "3.13"]
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 -r requirements_stable.txt
pip install pylint
- name: Pylint analysis
run: |
pylint --enable-all-extensions --extension-pkg-allow-list=orjson,ujson --disable=R,C,W $(git ls-files '*.py')
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- 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 -r requirements_stable.txt
pip install pylint
- name: Pylint analysis
run: |
pylint --enable-all-extensions --extension-pkg-allow-list=orjson,ujson --disable=R,C,W $(git ls-files '*.py')
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,16 @@ jobs:
- name: Validate inputs
run: "python3 ./scripts/validate.py ${{ inputs.type }} ${{ inputs.staging }}"

pylint:
name: "Run Pylint"
uses: ./.github/workflows/pylint_release.yml
with:
branch: ${{ inputs.branch }}

create-release:
name: "Create release"
runs-on: ubuntu-latest
needs: [validate-input]
needs: [validate-input, pylint]
steps:
- uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 990851d

Please sign in to comment.