mirror of
https://github.com/wickedyoda/public-setupfiles.git
synced 2026-11-16 13:31:56 -06:00
50 lines
987 B
YAML
50 lines
987 B
YAML
name: Code Quality Check
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- '**.py'
|
|
- '**.sh'
|
|
pull_request:
|
|
paths:
|
|
- '**.py'
|
|
- '**.sh'
|
|
|
|
jobs:
|
|
lint-python:
|
|
name: Python Code Linting
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install Python linters
|
|
run: |
|
|
pip install black flake8
|
|
|
|
- name: Run black
|
|
run: black --check .
|
|
|
|
- name: Run flake8
|
|
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
|
|
lint-shell:
|
|
name: Shell Script Linting
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install shellcheck
|
|
run: sudo apt-get install -y shellcheck
|
|
|
|
- name: Run shellcheck
|
|
run: |
|
|
find . -type f -name "*.sh" -exec shellcheck {} + |