From 90964ed1f7bd7d13c7340449fd9993d4171785d3 Mon Sep 17 00:00:00 2001 From: benyissa Date: Thu, 18 Jan 2024 14:51:10 +0100 Subject: [PATCH] Feat: split mypy and ruff workflows. --- .github/workflows/lint_format_checker.yaml | 26 ++++++++++++++ ..._quality_check.yml => typing_checker.yaml} | 35 ++++++------------- 2 files changed, 36 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/lint_format_checker.yaml rename .github/workflows/{code_quality_check.yml => typing_checker.yaml} (57%) diff --git a/.github/workflows/lint_format_checker.yaml b/.github/workflows/lint_format_checker.yaml new file mode 100644 index 0000000..5071bfa --- /dev/null +++ b/.github/workflows/lint_format_checker.yaml @@ -0,0 +1,26 @@ +name: Lint And Format Checker. + +on: + pull_request: + branches: [ "*" ] + push: + branches: [ "main" ] +jobs: + ruff: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [ "3.11" ] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Checking code formatting. + uses: chartboost/ruff-action@v1 + with: + args: format --check + - name: Running linter. + uses: chartboost/ruff-action@v1 \ No newline at end of file diff --git a/.github/workflows/code_quality_check.yml b/.github/workflows/typing_checker.yaml similarity index 57% rename from .github/workflows/code_quality_check.yml rename to .github/workflows/typing_checker.yaml index f02e9b4..4526132 100644 --- a/.github/workflows/code_quality_check.yml +++ b/.github/workflows/typing_checker.yaml @@ -1,47 +1,32 @@ -name: Code Quality Check +name: Static Types Checker. on: - push: - branches: - - main pull_request: - branches: - - '*' - + branches: [ "*" ] + push: + branches: [ "main" ] jobs: - pre-commit: - + mypy: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ["3.11"] - + python-version: [ "3.11" ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} cache: 'pip' cache-dependency-path: | **/requirement.txt **/test-requirement.txt - - - name: Installing dependencies. + - name: Install dependencies. run: | python -m pip install --upgrade pip python -m pip install -r requirement.txt python -m pip install -r tests/test-requirement.txt - - - name: Checking code formatting. - uses: chartboost/ruff-action@v1 - with: - args: format --check - - - name: Running linter. - uses: chartboost/ruff-action@v1 - - name: Running static types checker. run: | - mypy + mypy \ No newline at end of file