Skip to content

Commit

Permalink
ci: expanding testsuite to make sure pypi deployments are valid
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisborn committed Jan 8, 2024
1 parent bebff3a commit 55fa2db
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
---
name: build
on: [push]
name: build-and-test
on: [push, release]
jobs:
build:
test-source-install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Install package from source
run: pip install -e .
- name: Test package from source
run: |
python -c "import paperscraper"
- name: Run test suite
python -m pytest -sv paperscraper
verify-current-pypi-install:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install package from PyPI
run: |
python -m pip install --upgrade pip
pip install paperscraper
- name: Test package from PyPI
run: |
python -c "import paperscraper"
python -m pytest -sv paperscraper
1 change: 1 addition & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# pip install -r requirements.txt # not recommended
pip install setuptools wheel twine
- name: Build and publish
env:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/test_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: PyPI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
verify-master-for-potential-pypi-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Install from built distribution
run: |
pip install dist/*
- name: Run tests
run: |
python -m pytest paperscraper

0 comments on commit 55fa2db

Please sign in to comment.