mirror of
https://github.com/nfstream/nfstream.git
synced 2026-04-28 06:59:28 +00:00
113 lines
3.5 KiB
YAML
113 lines
3.5 KiB
YAML
name: build
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
release:
|
|
types: [created]
|
|
schedule:
|
|
# nightly build at 00:00.
|
|
- cron: '0 10 * * *'
|
|
jobs:
|
|
test:
|
|
name: ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
os: ["ubuntu-latest", "macOS-latest"]
|
|
python-version: [pypy3, 3.8, 3.7, 3.6]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Get pip cache dir
|
|
id: pip-cache
|
|
run: |
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
- name: Pip cache
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Display Python version
|
|
run: python -c "import sys; print(sys.version)"
|
|
- name: Install ubuntu Prerequisites
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install autoconf automake libtool pkg-config gettext libpcap-dev
|
|
sudo apt-get install libusb-1.0-0-dev libdbus-glib-1-dev libbluetooth-dev libnl-genl-3-dev flex bison
|
|
- name: Installing macOS prerequisites
|
|
if: startsWith(matrix.os, 'macOS')
|
|
run: |
|
|
brew install autoconf automake libtool pkg-config gettext
|
|
- name: Installing package dependencies
|
|
run: |
|
|
git clone --branch libgpg-error-1.39 https://github.com/gpg/libgpg-error
|
|
cd libgpg-error
|
|
./autogen.sh
|
|
./configure -enable-maintainer-mode --enable-static --enable-shared --with-pic --disable-doc --disable-nls
|
|
make
|
|
sudo make install
|
|
cd ..
|
|
rm -rf libgpg-error
|
|
git clone --branch libgcrypt-1.8.6 https://github.com/gpg/libgcrypt
|
|
cd libgcrypt
|
|
./autogen.sh
|
|
./configure -enable-maintainer-mode --enable-static --enable-shared --with-pic --disable-doc
|
|
make
|
|
sudo make install
|
|
cd ..
|
|
rm -rf libgcrypt
|
|
git clone --branch fanout https://github.com/tsnoam/libpcap
|
|
cd libpcap
|
|
./configure --enable-ipv6 --disable-universal --enable-dbus=no --without-libnl
|
|
make
|
|
sudo make install
|
|
cd ..
|
|
rm -rf libpcap
|
|
git clone --branch dev https://github.com/ntop/nDPI.git
|
|
cd nDPI
|
|
./autogen.sh
|
|
./configure
|
|
make
|
|
sudo make install
|
|
cd ..
|
|
rm -rf nDPI
|
|
cd tests/
|
|
chmod a+x build_results.sh
|
|
./build_results.sh
|
|
cd ..
|
|
pip install wheel twine setuptools codecov
|
|
pip install -r requirements.txt
|
|
MACOSX_DEPLOYMENT_TARGET=10.14 python setup.py bdist_wheel
|
|
ls nfstream/
|
|
- name: Generated wheel
|
|
run: |
|
|
ls dist/
|
|
- name: Testing and coverage report generation
|
|
run: |
|
|
coverage run tests.py
|
|
coverage combine
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v1
|
|
- name: Publish on Pypi
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
run: |
|
|
twine upload --skip-existing dist/*.whl
|