Skip to content

Commit

Permalink
Add new python pr workflow and skip tests that requires steamguard (#318
Browse files Browse the repository at this point in the history
)
  • Loading branch information
AlberTajuelo authored Nov 21, 2023
1 parent fb12f5b commit a00cf4d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 18 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/pythonpr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ci-python-unittest

on:
pull_request:
branches: [master]

jobs:
unittest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Unit tests
run: |
pip install .
python -m unittest discover -s ./test -p 'test_*.py'
32 changes: 16 additions & 16 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
3 changes: 2 additions & 1 deletion test/test_client.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import os
from decimal import Decimal
from unittest import TestCase
import unittest

from steampy.client import SteamClient
from steampy.exceptions import LoginRequired
from steampy.models import GameOptions, Asset
from steampy.utils import account_id_to_steam_id, load_credentials


@unittest.skip('Requires secrets/Steamguard.txt')
class TestSteamClient(TestCase):
@classmethod
def setUpClass(cls):
Expand Down
3 changes: 2 additions & 1 deletion test/test_market.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os
from unittest import TestCase
import unittest

from steampy.client import SteamClient
from steampy.exceptions import TooManyRequests
from steampy.models import GameOptions, Currency
from steampy.utils import load_credentials


@unittest.skip('Requires secrets/Steamguard.txt')
class TestMarket(TestCase):
@classmethod
def setUpClass(cls):
Expand Down

0 comments on commit a00cf4d

Please sign in to comment.