Skip to content

Commit

Permalink
Update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jan 2, 2024
1 parent 1709adb commit 40c1d35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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: |
Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/pypi-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
branches: [main]
tags: ["*"]
pull_request:
branches: [main]
release:
types:
- published
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 40c1d35

Please sign in to comment.