Skip to content

Commit c47252f

Browse files
committed
Try to avoid python version interference and add a similar Ubuntu LTS target
for comparison.
1 parent 4480d08 commit c47252f

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/python-c-ext-sanity-check.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,28 @@ jobs:
7373
uses: actions/setup-python@v5
7474
with:
7575
python-version: "3.x"
76+
- name: Set up git, findutils and make with apt
77+
run: |
78+
sudo apt install -y git findutils make
79+
- name: Install dependencies
80+
run: |
81+
sudo apt install -y libnss3-dev libpam-dev splint
82+
# We may need git installed to get a full repo clone rather than unpacked archive
83+
- name: Check out source repository
84+
uses: actions/checkout@v4
85+
with:
86+
fetch-depth: 0 # This is necessary to get the commits
87+
- name: Lint with splint
88+
run: |
89+
# NOTE: we only run splint error check for changed c files to limit noise
90+
# NOTE: point splint to Ubuntu's custom /usr/include/python3.x for Python.h
91+
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$')"
92+
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list $(python3-config --includes)
93+
94+
lint-c-ext-python3-ubuntu24.04:
95+
name: Sanity check c-extension module code in latest Ubuntu LTS python3
96+
runs-on: ubuntu-24.04
97+
steps:
7698
- name: Set up git, findutils and make with apt
7799
run: |
78100
sudo apt install -y git findutils make
@@ -91,7 +113,7 @@ jobs:
91113
echo "Lint changed code files: $(git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$')"
92114
git diff --diff-filter=ACMRTB --name-only HEAD^1 -- | grep -E '\.(c|h)$' | xargs -r splint +posixlib -D__gnuc_va_list=va_list $(python3-config --includes)
93115
94-
lint-python3-rocky9:
116+
lint-c-ext-python3-rocky9:
95117
name: Sanity check c-extension module code in default python3 on Rocky9
96118
runs-on: ubuntu-latest
97119
container:

0 commit comments

Comments
 (0)