From 468f9fa0c03981a7f890311443b5e00ebf7601d9 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 17 Aug 2024 08:55:59 +0200 Subject: [PATCH 1/3] migrate to https://github.com/hynek/build-and-inspect-python-package/ --- .github/workflows/main.yml | 42 ++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 87c84508..b3484207 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -93,9 +103,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Download built packages from the build-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: @@ -109,11 +121,11 @@ jobs: - name: Test without coverage if: "! matrix.use_coverage" - run: "tox -e ${{ matrix.tox_env }}" + run: "tox -e ${{ matrix.tox_env }} --installpkg dist/*.whl" - name: Test with coverage if: "matrix.use_coverage" - run: "tox -e ${{ matrix.tox_env }}-coverage" + run: "tox -e ${{ matrix.tox_env }}-coverage --installpkg dist/*.whl" - name: Upload coverage if: matrix.use_coverage && github.repository == 'pytest-dev/pluggy' @@ -125,27 +137,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 build-package job. + uses: actions/download-artifact@v4 with: - python-version: "3.11" - - - 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/gh-action-pypi-publish@v1.10.3 with: From 392b32fd2fe17a50ec59445e74786975a45036d7 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 17 Aug 2024 21:04:26 +0200 Subject: [PATCH 2/3] migrate to tox run comand --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3484207..eafee530 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -121,11 +121,11 @@ jobs: - name: Test without coverage if: "! matrix.use_coverage" - run: "tox -e ${{ matrix.tox_env }} --installpkg dist/*.whl" + 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 --installpkg dist/*.whl" + run: "tox run -e ${{ matrix.tox_env }}-coverage --installpkg dist/*.whl" - name: Upload coverage if: matrix.use_coverage && github.repository == 'pytest-dev/pluggy' From 0723defe3e076c59059a8046e6926306470825db Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 20 Aug 2024 08:45:37 +0200 Subject: [PATCH 3/3] gh workflow: enforce bash for globs --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eafee530..ea2a8e49 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -121,10 +121,12 @@ jobs: - name: Test without coverage if: "! matrix.use_coverage" + shell: bash run: "tox run -e ${{ matrix.tox_env }} --installpkg dist/*.whl" - name: Test with coverage if: "matrix.use_coverage" + shell: bash run: "tox run -e ${{ matrix.tox_env }}-coverage --installpkg dist/*.whl" - name: Upload coverage