From 30a90e2ae58c4e0f43276c08400e470c727e66f5 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 26 Nov 2024 11:15:36 +0100 Subject: [PATCH] CI: Test if we can build puppetboard In our normal test pipeline, we didn't verify if we can properly build the package. because of that, the last 6.0.0 release failed: ``` Run python setup.py build sdist bdist_wheel Traceback (most recent call last): File "/home/runner/work/puppetboard/puppetboard/setup.py", line 3, in from setuptools.command.test import test as TestCommand ModuleNotFoundError: No module named 'setuptools' ``` --- .github/workflows/publish-to-pypi.yml | 6 ++---- .github/workflows/tests.yml | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 8e7a04736..054840eeb 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -17,11 +17,9 @@ jobs: with: python-version: 3.12 - name: Install dependencies - run: | - pip install wheel + run: pip install wheel - name: Build - run: | - python setup.py build sdist bdist_wheel + run: python setup.py build sdist bdist_wheel - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@v1.12.2 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dd4f2aeff..d446e6477 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest strategy: - max-parallel: 5 matrix: python-version: [3.9, '3.10', 3.11, 3.12, 3.13] @@ -38,6 +37,23 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true + # this uses the same commands as in our release pipeline and ensures that we can still build puppetboard + test-build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9, '3.10', 3.11, 3.12, 3.13] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: pip install wheel + - name: Build + run: python setup.py build sdist bdist_wheel + build_docker_image: name: 'Test building a container' runs-on: ubuntu-latest @@ -70,6 +86,7 @@ jobs: tests: needs: - test + - test-build - build_docker_image - security-tests runs-on: ubuntu-latest