-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.89 KB
/
Copy pathbackend-lint.yml
File metadata and controls
84 lines (72 loc) · 2.89 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "Backend: Lint Python codebase"
on:
workflow_call:
inputs:
python-version:
required: true
type: string
plone-version:
required: true
type: string
working-directory:
required: false
default: backend
type: string
jobs:
deprecation-notice:
name: Deprecated
runs-on: ubuntu-latest
steps:
- name: Report deprecation
run: |
MESSAGE="This workflow is deprecated and will be removed. Use plone/meta/.github/workflows/backend-lint.yml@2.x instead."
echo "::warning title=Deprecated workflow::${MESSAGE}"
{
echo "> [!WARNING]"
echo "> ${MESSAGE}"
} >> "$GITHUB_STEP_SUMMARY"
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v10.0.1
with:
python-version: ${{ inputs.python-version }}
- name: Check formatting
if: ${{ success() || failure() }}
id: ruff-format
working-directory: ${{ inputs.working-directory }}
run: uvx ruff@latest format --diff
- name: Check lint
if: ${{ success() || failure() }}
id: ruff-lint
working-directory: ${{ inputs.working-directory }}
run: uvx ruff@latest check --diff
- name: Check XML / ZCML
if: ${{ success() || failure() }}
id: zpretty
working-directory: ${{ inputs.working-directory }}
run: uvx zpretty@latest --check src
- name: Check Package Metadata
if: ${{ success() || failure() }}
id: pyroma
working-directory: ${{ inputs.working-directory }}
run: uvx pyroma@latest -d .
- name: Check Python Versions
if: ${{ success() || failure() }}
id: py-versions
working-directory: ${{ inputs.working-directory }}
run: uvx check-python-versions@latest .
- name: Report
if: ${{ success() || failure() }}
run: |
echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY
echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
echo '| Format | ${{ steps.ruff-format.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Lint | ${{ steps.ruff-lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| XML / ZCML | ${{ steps.zpretty.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Package Metadata | ${{ steps.pyroma.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
echo '| Python Versions | ${{ steps.py-versions.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY