Skip to content

Merge pull request #1884 from IntelPython/update-coverage-workflow-fo… #5007

Merge pull request #1884 from IntelPython/update-coverage-workflow-fo…

Merge pull request #1884 from IntelPython/update-coverage-workflow-fo… #5007

# This is a workflow to format Python code with black formatter
name: Python Code Style
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
push:
branches: [master]
permissions: read-all
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# The isort job sorts all imports in .py, .pyx, .pxd files
isort:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: jamescurtin/isort-action@master
with:
configuration: "--check-only"
black:
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 30
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4.2.2
# Set up a Python environment for use in actions
- uses: actions/setup-python@v5
with:
python-version: '3.11'
# Run black code formatter
- uses: psf/black@stable
with:
src: "."
options: "--check"
version: "24.4.2"
flake8:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4.2.2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
uses: py-actions/flake8@v2