Skip to content

Commit

Permalink
CI: add pypi package check (#72)
Browse files Browse the repository at this point in the history
* partially addresses #62
* CI: add pypi package check
* CI test matrix: expanded exclusions
  - run all supported on ubuntu-latest
  - only run macOS-latest on 2.7 and lowest/highest supported 3.x
  - only run windows-latest on 2.7 and lowest/highest supported 3.x
  • Loading branch information
orbeckst authored Sep 27, 2022
1 parent 5d4dcaf commit 6eda6eb
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,25 @@ jobs:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
# Only test lowest and highest version on the expensive/slow
# macOS and windows runners (UPDATE when supported versions change):
exclude:
- os: macOS-latest
python-version: 3.5
- os: macOS-latest
python-version: 3.6
- os: macOS-latest
python-version: 3.7
- os: macOS-latest
python-version: 3.8
- os: macOS-latest
python-version: 3.9
- os: windows-latest
python-version: 3.6
- os: windows-latest
python-version: 3.7
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -78,3 +88,31 @@ jobs:
flags: unittests
fail_ci_if_error: true


pypi_check:
name: Check source package integrity (for PyPi deployment)
if: "github.repository == 'alchemistry/alchemtest'"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install tools
run: |
python -m pip install setuptools twine
- name: Build alchemtest source dist
run: |
python setup.py sdist
- name: Check package build sdist
run: |
DISTRIBUTION=$(ls -t1 dist/alchemtest-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no distribution dist/alchemtest-*.tar.gz found"; exit 1; }
echo "twine check $DISTRIBUTION"
twine check $DISTRIBUTION

0 comments on commit 6eda6eb

Please sign in to comment.