diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e65ac01..c65a0d3 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -22,13 +22,13 @@ on: jobs: test: + name: Python Test - ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: max-parallel: 4 matrix: python-version: - - "3.8" # EOL 2024-10 - - "3.9" + - "3.11" - "3.12" #- "3.13" steps: @@ -41,7 +41,7 @@ jobs: - name: Lint with flake8 run: | - pip install flake8==7.1.2 + pip install flake8==7.3.0 # stop the build if there are Python syntax errors or undefined names flake8 . --count --show-source --statistics --exclude=.venv # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide @@ -50,7 +50,7 @@ jobs: - name: Test with unittest (codecov) run: | pip install -r requirements.txt - pip install coverage==7.6 + pip install coverage==7.13 # discover all tests in the test directory python -m coverage run --omit '.venv/*' -m unittest discover test -vv -t . @@ -68,14 +68,27 @@ jobs: fail_ci_if_error: true verbose: true + test-results: + name: Python test results + needs: [test] + runs-on: ubuntu-latest + steps: + - name: Tests passed + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + - name: Tests failed + if: ${{ (contains(needs.*.result, 'failure')) }} + run: exit 1 + test-container-image: + name: Container Image Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run Checkov action id: checkov - uses: bridgecrewio/checkov-action@v12.1347.0 + uses: bridgecrewio/checkov-action@v12 with: framework: dockerfile dockerfile_path: Dockerfile @@ -98,6 +111,7 @@ jobs: --verify v2.3.5+test simulate: + name: Publish Simulation if: github.ref != 'refs/heads/master' needs: [test, test-container-image] runs-on: ubuntu-latest @@ -113,7 +127,8 @@ jobs: # Bump patch, then set commit SHA as metadata (+sha) for unique test.pypi.org versions # Using --metadata flag for PEP 440 compatibility (+ instead of -) pybump bump --level patch --file pyproject.toml - echo "app_version=$(pybump set --auto --metadata --file pyproject.toml)" >> $GITHUB_OUTPUT + # Append GitHub run number as a numeric release segment (PEP 440 / PyPI compliant) + sed -i 's/^\(version *= *"\)\([0-9.]*\)\("\)/\1\2.'"$GITHUB_RUN_NUMBER"'\3/' pyproject.toml - name: Install uv uses: astral-sh/setup-uv@v5 with: