diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml deleted file mode 100644 index d759c56..0000000 --- a/.github/workflows/pytest.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Tests - -on: - pull_request: - push: - branches: [master] - -jobs: - test: - runs-on: ubuntu-latest - - strategy: - matrix: - python-version: ['3.9'] - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox - - - name: Run tox - run: tox diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml new file mode 100644 index 0000000..076b008 --- /dev/null +++ b/.github/workflows/python-tests.yml @@ -0,0 +1,38 @@ +name: Python Tests + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + python -m venv venv + source venv/bin/activate + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Prepare environment + run: | + cp .env.example .env + + - name: Run tests + run: | + source venv/bin/activate + pytest + diff --git a/README.md b/README.md index 8fe5224..32e9ddd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 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) +# 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) A Telegram bot that searches Jackett indexers and uploads to rTorrent. Despite the repository name, this has no Plex integration.