Skip to content

Commit 00bc4af

Browse files
committed
github: Add Python continuous integration
Add three python continuous integration jobs: build-wheel: Build a wheel for the native build system build-wheel-pip: Build wheels suitable for uploading to pip flake: Python lint checker Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
1 parent 6ddcfcc commit 00bc4af

2 files changed

Lines changed: 81 additions & 2 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ runs:
2828
shell: bash
2929
- run: sudo apt-get install -y build-essential valgrind clang-tools lcov gperf astyle codespell
3030
shell: bash
31+
- name: Set up Python environment
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.13'
3135
- run: |
32-
sudo apt-get install -y python3 python3-setuptools python3-pip
33-
python3 -m pip install --upgrade pip
36+
python3 -m pip install build
3437
python3 -m pip install cython
38+
python3 -m pip install setuptools
3539
# Add cython to the path
3640
echo "$HOME/.local/bin" >> $GITHUB_PATH
3741
shell: bash

.github/workflows/python-ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#
2+
# Continuous Integration Workflow libseccomp Python Code
3+
#
4+
# Copyright (c) 2025 Oracle and/or its affiliates.
5+
# Author: Tom Hromatka <tom.hromatka@oracle.com>
6+
#
7+
8+
#
9+
# This library is free software; you can redistribute it and/or modify it
10+
# under the terms of version 2.1 of the GNU Lesser General Public License as
11+
# published by the Free Software Foundation.
12+
#
13+
# This library is distributed in the hope that it will be useful, but WITHOUT
14+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16+
# for more details.
17+
#
18+
# You should have received a copy of the GNU Lesser General Public License
19+
# along with this library; if not, see <http://www.gnu.org/licenses>.
20+
#
21+
22+
name: Python Continuous Integration
23+
on: ["push", "pull_request"]
24+
25+
jobs:
26+
build-wheel:
27+
name: Build Wheel
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Initialize libseccomp
32+
uses: ./.github/actions/setup
33+
- name: Build libseccomp
34+
run: |
35+
./configure --enable-python
36+
make check-build
37+
- name: Build wheel
38+
run: make python-wheel
39+
40+
build-wheel-pip:
41+
name: Build Wheels
42+
runs-on: ${{ matrix.os }}
43+
strategy:
44+
matrix:
45+
os: [ubuntu-24.04, ubuntu-24.04-arm, ubuntu-22.04, ubuntu-22.04-arm]
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Initialize libseccomp
49+
uses: ./.github/actions/setup
50+
- name: Install cibuildwheel
51+
run: python -m pip install cibuildwheel
52+
- name: Build libseccomp
53+
run: |
54+
./configure --enable-python
55+
make check-build
56+
- name: Build pip wheels
57+
run: make python-wheel-pip
58+
- uses: actions/upload-artifact@v4
59+
with:
60+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
61+
path: src/python/wheelhouse/*.whl
62+
63+
flake:
64+
name: Run Flake
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v2
68+
- name: Initialize libseccomp
69+
uses: ./.github/actions/setup
70+
- name: Install Flake Dependencies
71+
run: sudo apt-get install python3-flake8-quotes
72+
- name: flake8 Lint
73+
uses: reviewdog/action-flake8@v3
74+
with:
75+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)