Skip to content

Commit 3c5f0f9

Browse files
Update pipeline
1 parent 7ff149c commit 3c5f0f9

File tree

5 files changed

+324
-155
lines changed

5 files changed

+324
-155
lines changed
Lines changed: 44 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,57 @@
1-
name: build_test_linux
1+
name: Cross-platform Build
2+
23
on:
34
push:
4-
branches:
5-
- main
5+
branches: [ main ]
66
pull_request:
7-
branches:
8-
- main
7+
branches: [ main ]
8+
99
jobs:
10-
build_test_linux:
11-
name: ${{ matrix.python-version }} on ${{ matrix.os }}
10+
build:
1211
runs-on: ${{ matrix.os }}
1312
strategy:
14-
fail-fast: false
1513
matrix:
16-
os: ["ubuntu-latest"]
17-
python-version: ["pypy-3.9",
18-
"pypy-3.8",
19-
# "pypy-3.7",
20-
"3.11",
21-
"3.10",
22-
"3.9",
23-
"3.8",
24-
# "3.7"
25-
]
14+
os: [ubuntu-latest]
15+
16+
env:
17+
CMAKE_BUILD_TYPE: Release
2618

2719
steps:
28-
- uses: actions/checkout@v3
29-
with:
30-
submodules: recursive
31-
- name: Setup py-${{ matrix.python-version }}
32-
uses: actions/setup-python@v4
33-
with:
34-
python-version: ${{ matrix.python-version }}
35-
# Caching improves build time, we use pythonLocation to cache everything including wheels to avoid building
36-
# wheels at each build (pandas/Pypy is extremely time consuming)
37-
# sed replacement is performed to rectify PyPy path which ends with /bin
38-
# cache key takes into account the Python version of the runner to avoid version mismatch on updates.
39-
- name: Get pip cache path
40-
id: get-pip-path
41-
run: |
42-
id=$(echo ${{ env.pythonLocation }} | sed 's/\/bin//g')
43-
echo "::set-output name=id::$id"
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up CMake
24+
uses: lukka/get-cmake@v3.29.2
25+
26+
- name: Install dependencies (Linux)
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y \
30+
build-essential \
31+
libssl-dev \
32+
libopencv-dev \
33+
libpcap-dev \
34+
libpthread-stubs0-dev \
35+
git
4436
45-
- name: Pip cache
46-
uses: actions/cache@v3
47-
id: pip-cache
48-
with:
49-
path: ${{ steps.get-pip-path.outputs.id }}
50-
key: ${{ steps.get-pip-path.outputs.id }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}
37+
- name: Clone and build PcapPlusPlus (Linux/macOS)
38+
run: |
39+
git clone --depth 1 https://github.com/seladb/PcapPlusPlus.git
40+
cd PcapPlusPlus
41+
./configure-linux.sh --default || ./configure-mac_os_x.sh --default
42+
make -j$(nproc || sysctl -n hw.ncpu)
43+
sudo make install
44+
sudo ldconfig || true
5145
52-
- name: Install requirements
53-
if: steps.pip-cache.outputs.cache-hit != 'true'
54-
run: |
55-
python -m pip install --upgrade pip
56-
python -m pip install -r requirements.txt
46+
- name: Configure CMake
47+
run: |
48+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
5749
58-
- name: Build
59-
run: |
60-
python -m pip install .
50+
- name: Build
51+
run: cmake --build build --config Release --parallel
6152

62-
- name: Test
63-
if: startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.python-version, '3.10')
64-
run: |
65-
python -m pytest tests.py
53+
- name: Test binaries
54+
run: |
55+
./build/heiFIP --help || true
56+
./build/main --help || true
57+
shell: bash
Lines changed: 38 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,51 @@
1-
name: build_test_macos
1+
name: Cross-platform Build
2+
23
on:
34
push:
4-
branches:
5-
- main
5+
branches: [ main ]
66
pull_request:
7-
branches:
8-
- main
7+
branches: [ main ]
8+
99
jobs:
10-
build_test_macos:
11-
name: ${{ matrix.python-version }} on ${{ matrix.os }}
10+
build:
1211
runs-on: ${{ matrix.os }}
1312
strategy:
14-
fail-fast: false
1513
matrix:
16-
os: ["macos-12"]
17-
python-version: ["pypy-3.9",
18-
"pypy-3.8",
19-
# "pypy-3.7",
20-
# "3.11",
21-
# Not available yet.
22-
"3.10",
23-
"3.9",
24-
"3.8",
25-
# "3.7"
26-
]
14+
os: [macos-latest]
15+
16+
env:
17+
CMAKE_BUILD_TYPE: Release
2718

2819
steps:
29-
- uses: actions/checkout@v3
30-
with:
31-
submodules: recursive
32-
- name: Setup py-${{ matrix.python-version }}
33-
uses: actions/setup-python@v4
34-
with:
35-
python-version: ${{ matrix.python-version }}
36-
# Caching improves build time, we use pythonLocation to cache everything including wheels to avoid building
37-
# wheels at each build (pandas/Pypy is extremely time consuming)
38-
# sed replacement is performed to rectify PyPy path which ends with /bin
39-
# cache key takes into account the Python version of the runner to avoid version mismatch on updates.
40-
- name: Get pip cache path
41-
id: get-pip-path
42-
run: |
43-
id=$(echo ${{ env.pythonLocation }} | sed 's/\/bin//g')
44-
echo "::set-output name=id::$id"
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up CMake
24+
uses: lukka/get-cmake@v3.29.2
25+
26+
- name: Install dependencies (macOS)
27+
run: |
28+
brew update
29+
brew install openssl opencv libpcap cmake git
4530
46-
- name: Pip cache
47-
uses: actions/cache@v3
48-
id: pip-cache
49-
with:
50-
path: ${{ steps.get-pip-path.outputs.id }}
51-
key: ${{ steps.get-pip-path.outputs.id }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}
31+
- name: Clone and build PcapPlusPlus (Linux/macOS)
32+
run: |
33+
git clone --depth 1 https://github.com/seladb/PcapPlusPlus.git
34+
cd PcapPlusPlus
35+
./configure-linux.sh --default || ./configure-mac_os_x.sh --default
36+
make -j$(nproc || sysctl -n hw.ncpu)
37+
sudo make install
38+
sudo ldconfig || true
5239
53-
- name: Install requirements
54-
if: steps.pip-cache.outputs.cache-hit != 'true'
55-
run: |
56-
python -m pip install --upgrade pip
57-
python -m pip install -r requirements.txt
40+
- name: Configure CMake
41+
run: |
42+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
5843
59-
- name: Build
60-
run: |
61-
python -m pip install .
44+
- name: Build
45+
run: cmake --build build --config Release --parallel
6246

63-
- name: Test
64-
# On other versions then 3.9, we test only. (without coverage generation)
65-
if: startsWith(matrix.os, 'macos') && !startsWith(matrix.python-version, '3.9') && !startsWith(github.ref, 'refs/tags/')
66-
run: |
67-
python -m pytest tests.py
47+
- name: Test binaries
48+
run: |
49+
./build/heiFIP --help || true
50+
./build/main --help || true
51+
shell: bash
Lines changed: 39 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,48 @@
1-
name: build_test_windows
1+
name: Cross-platform Build
2+
23
on:
34
push:
4-
branches:
5-
- main
5+
branches: [ main ]
66
pull_request:
7-
branches:
8-
- main
7+
branches: [ main ]
8+
99
jobs:
10-
build_test_windows:
11-
name: ${{ matrix.python-version }} on ${{ matrix.os }}
10+
build:
1211
runs-on: ${{ matrix.os }}
1312
strategy:
14-
fail-fast: false
1513
matrix:
16-
os: ["windows-latest"]
17-
python-version: ["pypy-3.9",
18-
"pypy-3.8",
19-
# "pypy-3.7", does work atm.
20-
"3.11",
21-
"3.9",
22-
# "3.8",
23-
# "3.7"
24-
]
14+
os: [windows-latest]
15+
16+
env:
17+
CMAKE_BUILD_TYPE: Release
2518

2619
steps:
27-
- uses: actions/checkout@v3
28-
with:
29-
submodules: recursive
30-
- name: Setup py-${{ matrix.python-version }}
31-
uses: actions/setup-python@v4
32-
with:
33-
python-version: ${{ matrix.python-version }}
34-
35-
- name: Setup msys2
36-
uses: msys2/setup-msys2@v2
37-
with:
38-
msystem: MINGW64
39-
update: true
40-
install: git unzip mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-zlib mingw-w64-x86_64-libtiff mingw-w64-x86_64-freetype mingw-w64-x86_64-lcms2 mingw-w64-x86_64-libwebp mingw-w64-x86_64-openjpeg2 mingw-w64-x86_64-libimagequant mingw-w64-x86_64-libraqm mingw-w64-x86_64-gcc mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python3-setuptools
41-
42-
- name: Install requirements
43-
run: |
44-
python -m pip install --upgrade pip
45-
python -m pip install -r requirements.txt
46-
47-
- name: Build
48-
env:
49-
MSYSTEM: MINGW64
50-
MSYS2_PATH: D:/a/_temp/msys64
51-
run: |
52-
python -m pip install .
53-
54-
- name: Test
55-
# On other versions then 3.9, we test only. (without coverage generation)
56-
if: startsWith(matrix.os, 'windows') && !startsWith(matrix.python-version, '3.9') && !startsWith(github.ref, 'refs/tags/')
57-
run: |
58-
python -m pytest tests.py
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up CMake
24+
uses: lukka/get-cmake@v3.29.2
25+
26+
- name: Install dependencies (Windows)
27+
shell: pwsh
28+
run: |
29+
choco install cmake git openssl -y
30+
# OpenCV and Pcap might require manual handling or vcpkg if not prebuilt
31+
git clone https://github.com/microsoft/vcpkg
32+
.\vcpkg\bootstrap-vcpkg.bat
33+
.\vcpkg\vcpkg install opencv:x64-windows pcap:x64-windows
34+
echo "VCPKG_ROOT=${{ github.workspace }}\vcpkg" >> $env:GITHUB_ENV
35+
echo "CMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" >> $env:GITHUB_ENV
36+
37+
- name: Configure CMake
38+
run: |
39+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$env:CMAKE_TOOLCHAIN_FILE
40+
41+
- name: Build
42+
run: cmake --build build --config Release --parallel
43+
44+
- name: Test binaries
45+
run: |
46+
./build/heiFIP --help || true
47+
./build/main --help || true
48+
shell: bash

CITATION.cff

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cff-version: 1.1.0
2+
message: "If you use this software, please cite it as below."
3+
authors:
4+
- family-names: Machmeier
5+
given-names: Stefan
6+
orcid: "https://orcid.org/0000-0002-7028-1755"
7+
- family-names: Heuveline
8+
given-names: Vincent
9+
orcid: "https://orcid.org/0000-0002-2217-7558"
10+
title: "heiFIP: A network traffic image converter"
11+
doi: "10.5281/zenodo.8348868"
12+
version: v1.1.1
13+
date-released: 2023-09-15

0 commit comments

Comments
 (0)