Skip to content

Commit

Permalink
workflows: test wheel before publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
suvayu committed Jul 11, 2024
1 parent 73c2a02 commit 2aa7d20
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
- name: Install build tool
run: |
python -m pip install --upgrade pip
python -m pip install hatch
hatch env create test
- name: Build
run: |
hatch build
Expand All @@ -31,9 +30,41 @@ jobs:
if-no-files-found: error
retention-days: 7

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]

steps:
- name: Checkout pyse
uses: actions/checkout@v4
- name: Make dist directory
run: mkdir -p dist
- name: Download all wheels
uses: actions/download-artifact@v4
with:
path: dist
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tools
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov
# pytest-cov needed as config includes --cov
- name: Install PySE
run: |
pip install dist/*.whl
- name: Remove source, run tests on installed package
run: |
rm -rf sourcefinder
pytest --cov= test
publish:
# isolate from test, to prevent partial uploads
needs: build
needs: [build, test]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand Down

0 comments on commit 2aa7d20

Please sign in to comment.