Skip to content

Commit

Permalink
Add workflow to test PyPI wheels (#23)
Browse files Browse the repository at this point in the history
* Add workflow to test PyPI packages

* Fix yaml syntax; only install wheels

* Fix syntax for binary-only pip install

* Add test for sdist

* Better job names

* Fix syntax - remove unnecessary 'jobs'

* Change job trigger to a twice-monthly schedule
  • Loading branch information
mdickinson authored Jan 10, 2021
1 parent 6c3f68d commit 87b255b
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/test-from-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Test installation from PyPI

on:
schedule:
# Run at 02:37 UTC on the 11th and 25th of every month
- cron: '37 2 11,25 * *'

jobs:
test-pypi-wheel:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
python-architecture: [x86, x64]
exclude:
- os: macos-latest
python-architecture: x86
- os: ubuntu-latest
python-architecture: x86

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

steps:
- name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }})
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Install prerequisites
run: |
python -m pip install --upgrade pip setuptools
python -m pip install wheel
- name: Install wheel from PyPI
run: |
python -m pip install --only-binary :all: ibm2ieee
- name: Run tests in a clean directory
run: |
mkdir testdir
cd testdir
python -m unittest discover -v ibm2ieee
test-pypi-sdist:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
python-architecture: [x86, x64]
exclude:
- os: macos-latest
python-architecture: x86
- os: ubuntu-latest
python-architecture: x86

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

steps:
- name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }})
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Install prerequisites
run: |
python -m pip install --upgrade pip setuptools
python -m pip install wheel
- name: Install from PyPI sdist
run: |
python -m pip install --no-binary ibm2ieee ibm2ieee
- name: Run tests in a clean directory
run: |
mkdir testdir
cd testdir
python -m unittest discover -v ibm2ieee

0 comments on commit 87b255b

Please sign in to comment.