Skip to content

Commit dce87e3

Browse files
authored
feat: add GitHub Actions workflow for Python tests (#21)
* feat: add GitHub Actions workflow for Python tests - Added a workflow to run Python tests on pull requests, pushes to the main branch, and manual triggers. - Configures Python 3.9.2 and sets up a virtual environment. - Copies `.env.example` to `.env` before running tests. - Executes tests using pytest. - Change badge
1 parent 9c85aab commit dce87e3

File tree

3 files changed

+39
-32
lines changed

3 files changed

+39
-32
lines changed

.github/workflows/pytest.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/python-tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Python Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: 3.9
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m venv venv
26+
source venv/bin/activate
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.txt
29+
30+
- name: Prepare environment
31+
run: |
32+
cp .env.example .env
33+
34+
- name: Run tests
35+
run: |
36+
source venv/bin/activate
37+
pytest
38+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Plex Search Search Bot Simple [![Tests](https://github.com/thomasasfk/PlexSearchBotSimple/actions/workflows/pytest.yml/badge.svg)](https://github.com/thomasasfk/PlexSearchBotSimple/actions/workflows/pytest.yml)
1+
# Plex Search Search Bot Simple [![Tests](https://github.com/thomasasfk/PlexSearchBotSimple/actions/workflows/python-tests.yml/badge.svg)](https://github.com/thomasasfk/PlexSearchBotSimple/actions/workflows/python-tests.yml)
22

33
A Telegram bot that searches Jackett indexers and uploads to rTorrent. Despite the repository name, this has no Plex integration.
44

0 commit comments

Comments
 (0)