-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate to hynek/build-and-inspect-python-package for packaging and t…
…esting
- Loading branch information
1 parent
86c04e7
commit 4152891
Showing
1 changed file
with
24 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,17 @@ on: | |
- main | ||
|
||
jobs: | ||
build: | ||
check-package: | ||
name: Build & inspect our package. | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: hynek/build-and-inspect-python-package@v2 | ||
test: | ||
needs: [check-package] | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
|
@@ -87,9 +97,11 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download built packages from the check-package job. | ||
uses: actions/download-artifact@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
name: Packages | ||
path: dist | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
|
@@ -103,11 +115,13 @@ jobs: | |
- name: Test without coverage | ||
if: "! matrix.use_coverage" | ||
run: "tox -e ${{ matrix.tox_env }}" | ||
shell: bash | ||
run: "tox run -e ${{ matrix.tox_env }} --installpkg dist/*.whl" | ||
|
||
- name: Test with coverage | ||
if: "matrix.use_coverage" | ||
run: "tox -e ${{ matrix.tox_env }}-coverage" | ||
shell: bash | ||
run: "tox run -e ${{ matrix.tox_env }}-coverage --installpkg dist/*.whl" | ||
|
||
- name: Upload coverage | ||
if: matrix.use_coverage && github.repository == 'pytest-dev/pluggy' | ||
|
@@ -119,27 +133,17 @@ jobs: | |
verbose: true | ||
|
||
deploy: | ||
needs: [check-package] | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pluggy' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v5 | ||
- name: Download built packages from the check-package job. | ||
uses: actions/download-artifact@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade build | ||
- name: Build package | ||
run: python -m build --sdist --wheel --outdir dist/ | ||
|
||
name: Packages | ||
path: dist | ||
- name: Publish package | ||
uses: pypa/[email protected] | ||
with: | ||
|