Skip to content

Commit

Permalink
updates CI
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Nov 1, 2024
1 parent 515be09 commit 37ebd4b
Showing 1 changed file with 30 additions and 33 deletions.
63 changes: 30 additions & 33 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,73 +19,70 @@ defaults:


concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
group: "${{ github.workflow }}-${{ github.ref }}-lint"
cancel-in-progress: true


permissions:
contents: read

jobs:
changes:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: check files
runs-on: ubuntu-latest
timeout-minutes: 3
outputs:
lint: ${{ steps.changes.outputs.lint }}
docker: ${{ steps.changes.outputs.docker_base }}
steps:
- run: git config --global --add safe.directory $(realpath .)
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- id: changes
name: Check for backend file changes
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
with:
base: ${{ github.ref }}
token: ${{ github.token }}
filters: .github/file-filters.yml
# changes:
## if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
# name: check files
# runs-on: ubuntu-latest
# timeout-minutes: 3
# outputs:
# lint: ${{ steps.changes.outputs.lint }}
# docker: ${{ steps.changes.outputs.docker_base }}
# steps:
# - run: git config --global --add safe.directory $(realpath .)
# - uses: actions/checkout@v4
# - id: changes
# name: Check for backend file changes
# uses: dorny/paths-filter@v3 # v3.0.0
# with:
# base: ${{ github.ref }}
# token: ${{ github.token }}
# filters: .github/file-filters.yml

flake8:
needs: changes
# needs: changes
# if: github.event.pull_request.draft == false && needs.changes.outputs.lint
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false && needs.changes.outputs.lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.12.6'
- name: Install requirements
run: pip install flake8 pycodestyle
- name: Check syntax
# Stop the build if there are Python syntax errors or undefined names
run: flake8 src/ --count --statistics --max-line-length=127

- name: Warnings
run: flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --extend-exclude=""
run: flake8 src/
isort:
needs: changes
# needs: changes
# if: github.event.pull_request.draft == false && needs.changes.outputs.lint
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false && needs.changes.outputs.lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.12.6'
- name: Install requirements
run: pip install isort
- name: iSort
run: isort src/ --check-only
black:
needs: changes
# needs: changes
# if: github.event.pull_request.draft == false && needs.changes.outputs.lint
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false && needs.changes.outputs.lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.12.6'
- name: Install requirements
run: pip install black
run: pip install "black==22.12.0"
- name: Black
run: black src/ --check --config pyproject.toml

0 comments on commit 37ebd4b

Please sign in to comment.