Skip to content

Merge pull request #447 from GoSecure/fix-mitm-hostip-logs #656

Merge pull request #447 from GoSecure/fix-mitm-hostip-logs

Merge pull request #447 from GoSecure/fix-mitm-hostip-logs #656

Workflow file for this run

name: Build
on:
pull_request:
branches:
- '**'
push:
branches:
- master
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: docker build -t pyrdp .
- name: "Smoke test docker image: pyrdp-convert.py"
run: docker run pyrdp pyrdp-convert.py -h
- name: "Smoke test docker image: pyrdp-player.py"
run: docker run pyrdp pyrdp-player.py -h
- name: "Smoke test docker image: pyrdp-mitm.py"
run: docker run pyrdp pyrdp-mitm.py -h
- name: Build slim Docker image
run: docker build -f Dockerfile.slim -t pyrdp .
- name: "Smoke test docker image: pyrdp-convert.py"
run: docker run pyrdp pyrdp-convert.py -h
- name: "Smoke test docker image: pyrdp-player.py"
run: docker run pyrdp pyrdp-player.py -h
- name: "Smoke test docker image: pyrdp-mitm.py"
run: docker run pyrdp pyrdp-mitm.py -h
install-and-test-ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
# Lets try to keep testing an LTS python and latest python
python-version: ['3.7', '3.11']
name: Install and test on Ubuntu with Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Python version
run: python --version
- name: Pip version
run: pip --version
- name: Update apt
run: sudo apt update -y
- name: Install setuptools
run: sudo apt install python3-setuptools
- name: Install PyRDP dependencies
run: sudo apt install libgl1-mesa-glx git python3-dev
- name: Install wheel
working-directory: .
run: pip install wheel
- name: Install PyRDP
working-directory: .
run: pip install -U -e .[full]
- name: Install ci dependencies
run: pip install -r requirements-ci.txt
- name: Extract test files
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: test/files/test_files.zip
pathTarget: test/files
- name: Extract test file for regression test 428
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: test/files/test_convert_428.zip
pathTarget: test/files
- name: Integration Test with a prerecorded PCAP.
working-directory: ./
run: coverage run test/test_prerecorded.py
- name: pyrdp-mitm.py initialization integration test
working-directory: ./
run: coverage run --append test/test_mitm_initialization.py dummy_value
- name: Running pyrdp-player and pyrdp-convert integration tests with verifications
working-directory: ./
run: ./test/integration.sh
- name: Run unit tests
working-directory: ./
run: coverage run --append -m unittest discover -v
- name: Coverage report
working-directory: ./
run: coverage report --fail-under=40
install-and-test-windows:
runs-on: windows-latest
strategy:
matrix:
# Lets try to keep testing an LTS python and latest python
# FIXME: Windows with 3.11 doesn't work since PySide2 isn't supported. see #436
python-version: ['3.7', '3.10']
name: Install and test on Windows with Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Python version
run: python --version
- name: Pip version
run: pip --version
- name: Install wheel
working-directory: .
run: pip install wheel
- name: Install PyRDP
working-directory: .
run: pip install -U -e .[full]
- name: Install coverage
working-directory: .
run: pip install coverage
- name: Extract test files
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: test/files/test_files.zip
pathTarget: test/files
- name: Integration Test with a prerecorded PCAP.
working-directory: ./
run: coverage run test/test_prerecorded.py
- name: pyrdp-mitm.py initialization test
working-directory: ./
run: coverage run --append test/test_mitm_initialization.py dummy_value
- name: pyrdp-player.py read a replay in headless mode test
working-directory: ./
run: coverage run --append bin/pyrdp-player.py --headless test/files/test_session.replay
- name: pyrdp-convert.py to MP4
working-directory: ./
run: coverage run --append bin/pyrdp-convert.py test/files/test_convert.pyrdp -f mp4
- name: Verify the MP4 file
working-directory: ./
run: file test_convert.mp4 | grep "MP4 Base Media"
- name: Run unit tests
working-directory: ./
run: coverage run --append -m unittest discover -v
- name: Coverage report
working-directory: ./
run: coverage report --fail-under=40