-
Notifications
You must be signed in to change notification settings - Fork 252
167 lines (139 loc) · 5.1 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
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"
run: docker run pyrdp pyrdp-convert -h
- name: "Smoke test docker image: pyrdp-player"
run: docker run pyrdp pyrdp-player -h
- name: "Smoke test docker image: pyrdp-mitm"
run: docker run pyrdp pyrdp-mitm -h
- name: Build slim Docker image
run: docker build -f Dockerfile.slim -t pyrdp .
- name: "Smoke test docker image: pyrdp-convert"
run: docker run pyrdp pyrdp-convert -h
- name: "Smoke test docker image: pyrdp-player"
run: docker run pyrdp pyrdp-player -h
- name: "Smoke test docker image: pyrdp-mitm"
run: docker run pyrdp pyrdp-mitm -h
install-and-test-ubuntu:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
# Lets try to keep testing an LTS python and latest python
python-version: ['3.7', '3.11']
runs-on: ${{ matrix.os }}
name: Install and test on Ubuntu ${{ matrix.os }} 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 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 initialization test
working-directory: ./
run: coverage run --append test/test_mitm_initialization.py dummy_value
- name: pyrdp-player read a replay in headless mode test
working-directory: ./
run: coverage run --append -m pyrdp.bin.player --headless test/files/test_session.replay
- name: pyrdp-convert to MP4
working-directory: ./
run: coverage run --append -m pyrdp.bin.convert 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