Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #147
This file contains 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
# 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/[email protected] | |
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 |