From 40c1d3566c0a93c1f3a16207eef9019bda386ac8 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Tue, 2 Jan 2024 15:12:43 +0100 Subject: [PATCH] Update actions --- .github/workflows/ci.yml | 21 ++++++++++----------- .github/workflows/pypi-package.yml | 7 +++---- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cf673e..4d79a45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,16 +5,14 @@ on: push: branches: ["main"] pull_request: - branches: ["main"] - -permissions: - contents: read + workflow_dispatch: env: FORCE_COLOR: "1" # Make tools pretty. PIP_DISABLE_PIP_VERSION_CHECK: "1" PIP_NO_PYTHON_VERSION_WARNING: "1" +permissions: {} jobs: lint: @@ -71,14 +69,14 @@ jobs: run: python -Im tox run -e mypy-api - name: Upload coverage data - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: coverage-data + name: coverage-data-${{ matrix.python-version }} path: .coverage.* if-no-files-found: ignore coverage: - name: Combine & check coverage. + name: Combine & check coverage needs: tests runs-on: ubuntu-latest @@ -89,9 +87,10 @@ jobs: python-version-file: .python-version-default cache: pip - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: coverage-data + pattern: coverage-data-* + merge-multiple: true - name: Combine coverage & fail if it's <100%. run: | @@ -101,13 +100,13 @@ jobs: python -Im coverage html --skip-covered --skip-empty # Report and write to summary. - python -Im coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY + python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY # Report again and fail if under 100%. python -Im coverage report --fail-under=100 - name: Upload HTML report if check failed. - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: html-report path: htmlcov diff --git a/.github/workflows/pypi-package.yml b/.github/workflows/pypi-package.yml index 490ce00..85e55ef 100644 --- a/.github/workflows/pypi-package.yml +++ b/.github/workflows/pypi-package.yml @@ -6,7 +6,6 @@ on: branches: [main] tags: ["*"] pull_request: - branches: [main] release: types: - published @@ -27,7 +26,7 @@ jobs: with: fetch-depth: 0 - - uses: hynek/build-and-inspect-python-package@v1 + - uses: hynek/build-and-inspect-python-package@v2 # Upload to Test PyPI on every commit on main. release-test-pypi: @@ -39,7 +38,7 @@ jobs: steps: - name: Download packages built by build-and-inspect-python-package - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: Packages path: dist @@ -59,7 +58,7 @@ jobs: steps: - name: Download packages built by build-and-inspect-python-package - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: Packages path: dist