-
Notifications
You must be signed in to change notification settings - Fork 123
191 lines (186 loc) · 6.12 KB
/
build.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on: [push, pull_request]
env:
DELUGE_1_HOST: localhost:48846
DELUGE_1_USERNAME: localclient
DELUGE_1_PASSWORD: set-later
DELUGE_2_HOST: localhost:58846
DELUGE_2_USERNAME: localclient
DELUGE_2_PASSWORD: set-later
QBITTORRENT_3_HOST: http://localhost:18080
QBITTORRENT_3_USERNAME: admin
QBITTORRENT_3_PASSWORD: adminadmin
QBITTORRENT_4_HOST: http://localhost:8080
QBITTORRENT_4_USERNAME: admin
QBITTORRENT_4_PASSWORD: adminadmin
TRANSMISSION_2_8_HOST: http://localhost:19091
TRANSMISSION_2_8_USERNAME: username
TRANSMISSION_2_8_PASSWORD: password
TRANSMISSION_2_9_HOST: http://localhost:9091
TRANSMISSION_2_9_USERNAME: username
TRANSMISSION_2_9_PASSWORD: password
UTORRENT_HOST: http://localhost:28080
UTORRENT_USERNAME: admin
UTORRENT_PASSWORD:
jobs:
build:
runs-on: ubuntu-latest
services:
qbittorrent-latest:
image: lscr.io/linuxserver/qbittorrent:latest
env:
PUID: 1000
PGID: 1000
TZ: Europe/London
WEBUI_PORT: 8080
volumes:
- /tmp/qbittorrent-latest/config:/config
ports:
- 8080:8080
- 20000:6881
- 20000:6881/udp
qbittorrent-3:
image: wernight/qbittorrent:3.3.3
env:
PUID: 1001
PGID: 1001
TZ: Europe/London
ports:
- 18080:8080
- 20001:6881
- 20001:6881/udp
transmission-latest:
image: lscr.io/linuxserver/transmission:latest
env:
PUID: 2000
PGID: 2000
TZ: Europe/London
TRANSMISSION_WEB_HOME: /combustion-release/
USER: username
PASS: password
ports:
- 9091:9091
- 20002:51413
- 20002:51413/udp
transmission-294:
image: linuxserver/transmission:2.94-r3-ls53
env:
PUID: 2001
PGID: 2001
USER: username
PASS: password
ports:
- 19091:9091
- 20003:51413
- 20003:51413/udp
deluge-latest:
image: lscr.io/linuxserver/deluge:latest
env:
PUID: 3000
PGID: 3000
TZ: Europe/London
volumes:
- /tmp/deluge-latest/config:/config
ports:
- 58846:58846
- 20004:6881
- 20004:6881/udp
deluge-1:
image: linuxserver/deluge:amd64-ab9135a6-ls19
env:
PUID: 3001
PGID: 3001
TZ: Europe/London
volumes:
- /tmp/deluge-1/config:/config
ports:
- 48846:58846
- 20005:6881
- 20005:6881/udp
utorrent-latest:
image: ekho/utorrent:latest
env:
UID: 4000
GID: 4000
ports:
- 28080:8080
- 20006:6881
- 20006:6881/udp
strategy:
fail-fast: false
matrix:
python-version: [
"3.7",
"3.8",
"3.9",
"3.10",
"3.11",
"3.12"
]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install --upgrade pytest
python -m pip install --upgrade setuptools
python -m pip install -r dev-requirements.txt
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Allow remote access of Deluge Daemon
run: |
docker stop ${{ job.services.deluge-latest.id }}
docker stop ${{ job.services.deluge-1.id }}
sudo sed -i 's/"allow_remote": false/"allow_remote": true/g' /tmp/deluge-latest/config/core.conf
sudo sed -i 's/"allow_remote": false/"allow_remote": true/g' /tmp/deluge-1/config/core.conf
docker start ${{ job.services.deluge-latest.id }}
docker start ${{ job.services.deluge-1.id }}
- name: Extract passwords of Deluge Daemon
run: |
echo "DELUGE_2_PASSWORD=$(sudo cat /tmp/deluge-latest/config/auth | sed 's/.*:\(.*\):.*/\1/g')" >> $GITHUB_ENV
echo "DELUGE_1_PASSWORD=$(sudo cat /tmp/deluge-1/config/auth | sed 's/.*:\(.*\):.*/\1/g')" >> $GITHUB_ENV
- name: Setup passwords of qBittorrent latest
run: |
docker stop ${{ job.services.qbittorrent-latest.id }}
echo 'WebUI\Password_PBKDF2="@ByteArray(+BwJe86psDlDzA5u7ebg9Q==:yZeQKzvuRW/Mn+qL0FS8Nt91A53x5Ow8YGNOq0KusmleU9xn60RWx9kDXKOEqIe+eJX5bQ9UJ4GgR16UWprRSw==)"' | sudo tee -a /tmp/qbittorrent-latest/config/qBittorrent/qBittorrent.conf
docker start ${{ job.services.qbittorrent-latest.id }}
- name: Sleep for a while
run: |
sleep $((10 + $RANDOM % 50))
- name: Test with pytest
run: |
py.test -s --cov-report=xml --cov --log-level=INFO
- name: Save coverage report
uses: actions/upload-artifact@v2
with:
name: coverage.xml
path: coverage.xml
codacy-coverage-reporter:
runs-on: ubuntu-latest
name: codacy-coverage-reporter
needs: build
steps:
- uses: actions/checkout@v2
- name: Load coverage report
uses: actions/download-artifact@v2
with:
name: coverage.xml
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# or
# api-token: ${{ secrets.CODACY_API_TOKEN }}
coverage-reports: coverage.xml