Skip to content

Commit 18c2b95

Browse files
committed
Add a soundness check to lint Python files
1 parent ede60ab commit 18c2b95

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

.github/workflows/soundness.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,20 @@ on:
5151
type: string
5252
description: "Container image for the shell check job. Defaults to latest Swift Ubuntu image."
5353
default: "swift:6.0-noble"
54+
python_lint_enabled:
55+
type: boolean
56+
description: "Boolean to enable the Python lint job. Defaults to true."
57+
default: true
58+
python_lint_container_image:
59+
type: string
60+
description: "Container image for the Python lint job. Defaults to latest Swift Ubuntu image."
61+
default: "swift:6.0-noble"
5462

5563
## We are cancelling previously triggered workflow runs
5664
concurrency:
5765
group: ${{ github.workflow }}-${{ github.ref }}-soundness
5866
cancel-in-progress: true
59-
67+
6068
jobs:
6169
api-breakage-check:
6270
name: API breakage check
@@ -177,3 +185,21 @@ jobs:
177185
run: |
178186
apt-get -qq update && apt-get -qq -y install shellcheck
179187
git ls-files -z '*.sh' | xargs -0 shellcheck
188+
python-lint:
189+
name: Python lint
190+
if: ${{ inputs.python_lint_enabled }}
191+
runs-on: ubuntu-latest
192+
container:
193+
image: ${{ inputs.python_lint_container_image }}
194+
timeout-minutes: 5
195+
steps:
196+
- name: Checkout repository
197+
uses: actions/checkout@v4
198+
with:
199+
persist-credentials: false
200+
- name: Run shellcheck
201+
run: |
202+
apt-get -qq update && apt-get -qq -y install python3 python3-pip python3-venv
203+
pip3 install flake8 flake8-import-order --break-system-packages
204+
cd ${GITHUB_WORKSPACE}
205+
flake8

0 commit comments

Comments
 (0)