-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (31 loc) · 1.03 KB
/
python-style.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Python Style Checker
on: [push, pull_request]
jobs:
style-check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v2
# Use the custom action to set up the Python environment
- name: Setup Python Environment
uses: ./.github/actions/setup-python-environment
with:
python-version: ${{ matrix.python-version }}
poetry-version: '1.6.1'
# Cache style dependencies (e.g., Black)
- name: Cache Black Installation
id: cache-black
uses: actions/cache@v2
with:
path: ./.venv
key: ${{ runner.os }}-black-${{ matrix.python-version }}
# Install Black if it's not already cached
- name: Install Style Checker
run: poetry add --dev black
if: steps.cache-black.outputs.cache-hit != 'true'
# Lint with Black
- name: Lint with Black
run: poetry run black --check .
continue-on-error: true