fix: docker cap_net_admin requirement + Windows readline compatibility #51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: Leetha Lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - run: pip install ruff | |
| - run: ruff check src/ | |
| test-linux: | |
| runs-on: ubuntu-latest | |
| name: Leetha Linux Tests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Create frontend dist placeholder | |
| run: python -c "import pathlib; d=pathlib.Path('src/leetha/ui/web/dist'); d.mkdir(parents=True,exist_ok=True); f=d/'index.html'; f.exists() or f.write_text('<html></html>')" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest pytest-asyncio httpx | |
| - name: Run tests | |
| env: | |
| PYTHONPATH: src | |
| run: python -m pytest spec/ -v --tb=short | |
| test-macos: | |
| runs-on: macos-latest | |
| name: Leetha macOS Tests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Create frontend dist placeholder | |
| run: python -c "import pathlib; d=pathlib.Path('src/leetha/ui/web/dist'); d.mkdir(parents=True,exist_ok=True); f=d/'index.html'; f.exists() or f.write_text('<html></html>')" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest pytest-asyncio httpx | |
| - name: Run tests | |
| env: | |
| PYTHONPATH: src | |
| run: python -m pytest spec/ -v --tb=short | |
| test-windows: | |
| runs-on: windows-latest | |
| name: Leetha Windows Tests | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Create frontend dist placeholder | |
| run: python -c "import pathlib; d=pathlib.Path('src/leetha/ui/web/dist'); d.mkdir(parents=True,exist_ok=True); f=d/'index.html'; f.exists() or f.write_text('<html></html>')" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest pytest-asyncio httpx | |
| - name: Run tests | |
| env: | |
| PYTHONPATH: src | |
| run: python -m pytest spec/ -v --tb=short | |
| shell: bash | |
| build-frontend: | |
| runs-on: ubuntu-latest | |
| name: Build Leetha Frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| - run: cd frontend && bun install --frozen-lockfile && bun run build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: src/leetha/ui/web/dist/ | |
| build-deb: | |
| needs: [test-linux, build-frontend] | |
| runs-on: ubuntu-latest | |
| name: Build Leetha Deb | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: src/leetha/ui/web/dist/ | |
| - name: Install fpm | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y ruby ruby-dev | |
| sudo gem install fpm | |
| - name: Build deb package | |
| run: | | |
| python -m venv /tmp/leetha-venv | |
| /tmp/leetha-venv/bin/pip install . | |
| fpm -s dir -t deb \ | |
| --name leetha \ | |
| --version 1.0.0 \ | |
| --architecture amd64 \ | |
| --depends python3 \ | |
| --depends libpcap0.8 \ | |
| --description "Passive network fingerprinting and analysis engine" \ | |
| --url "https://github.com/tjnull/leetha" \ | |
| --license "GPL-3.0" \ | |
| --after-install /dev/null \ | |
| /tmp/leetha-venv/lib/=/usr/lib/leetha/ \ | |
| /tmp/leetha-venv/bin/leetha=/usr/bin/leetha | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: leetha-deb | |
| path: "*.deb" | |
| build-rpm: | |
| needs: [test-linux, build-frontend] | |
| runs-on: ubuntu-latest | |
| name: Build Leetha RPM | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: src/leetha/ui/web/dist/ | |
| - name: Install fpm | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y ruby ruby-dev rpm | |
| sudo gem install fpm | |
| - name: Build rpm package | |
| run: | | |
| python -m venv /tmp/leetha-venv | |
| /tmp/leetha-venv/bin/pip install . | |
| fpm -s dir -t rpm \ | |
| --name leetha \ | |
| --version 1.0.0 \ | |
| --architecture x86_64 \ | |
| --depends python3 \ | |
| --depends libpcap \ | |
| --description "Passive network fingerprinting and analysis engine" \ | |
| --url "https://github.com/tjnull/leetha" \ | |
| --license "GPL-3.0" \ | |
| /tmp/leetha-venv/lib/=/usr/lib/leetha/ \ | |
| /tmp/leetha-venv/bin/leetha=/usr/bin/leetha | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: leetha-rpm | |
| path: "*.rpm" |