Skip to content

Commit

Permalink
changed tests to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDoee committed Feb 17, 2024
1 parent 0249274 commit 0e2583a
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 71 deletions.
69 changes: 0 additions & 69 deletions .appveyor.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Tests

on:
push:
branches: [ master, develop, main ]
pull_request:

workflow_dispatch:

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python: ['3.9', '3.12']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Setup Deluge
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
choco install deluge
else
sudo add-apt-repository ppa:deluge-team/develop -y
sudo apt-get -qq update
sudo apt-get install deluged -y
fi
shell: bash

- name: Start Deluge
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
mkdir $APPDATA/deluge
"c:/Program Files/Deluge/deluged.exe" &
else
/usr/bin/deluged --version
/usr/bin/deluged &
fi
sleep 10
shell: bash

- name: Install project
run: |
python -m pip install -U pytest
python -m pip install .
- name: Run tests
run: python -m pytest .
41 changes: 41 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish to pypi
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
tags:
- 1.*

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build-and-publish:
name: Build and publish Python
runs-on: ubuntu-latest
environment:
name: deluge-client
url: https://test.pypi.org/p/deluge-client
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install pypa/build
run: >-
python -m
pip install
build
- name: Build packages
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Deluge Client
=============
.. .. image:: https://ci.appveyor.com/api/projects/status/8s3g4uucg2xcay6v/branch/develop?svg=true
.. :target: https://ci.appveyor.com/project/AndersJensen/deluge-client
.. image:: https://github.com/JohnDoee/deluge-client/actions/workflows/main.yml/badge.svg?branch=master

A lightweight pure-python rpc client for deluge.
Note, does not support events and any additional replies from deluge will mess up the datastream.
Expand Down

0 comments on commit 0e2583a

Please sign in to comment.