Skip to content

Commit

Permalink
CI: Upgrade most GitHub actions (#1476)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Mar 31, 2024
1 parent f879da0 commit f007710
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
# To make it secure against malicious pull requests, you cannot trust files in the PR,
# because pull_request_target jobs have more permissions than pull_request jobs.
# Here we place the PR's stuff to a subdirectory named "pr".
- uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
path: ./pr
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
for dep in content["project"]["optional-dependencies"]["dev"]:
print(dep)
' >> pr/requirements-dev.txt
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: ./pr
commit_message: "Run pycln, pyupgrade, black and isort"
44 changes: 28 additions & 16 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
Expand All @@ -28,31 +28,43 @@ jobs:
time mypy --platform darwin --python-version 3.10 porcupine docs/extensions.py
time mypy --platform darwin --python-version 3.11 porcupine docs/extensions.py
pytest:
pytest-windows:
timeout-minutes: 10
runs-on: windows-latest
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install wheel
- run: pip install -r requirements-dev.txt
- if: matrix.os == 'ubuntu-latest'
# Make sure that it doesn't crash with Noto Color Emoji installed
run: sudo apt install --no-install-recommends fonts-noto-color-emoji tkdnd
- if: matrix.os == 'windows-latest'
- name: Download tkdnd
run: |
python scripts/download-tkdnd.py
echo "TCLLIBPATH=lib" >> $env:GITHUB_ENV
- uses: GabrielBB/[email protected]
- run: python -m pytest --durations=10

pytest-linux:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
run: python -m pytest --durations=10
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install wheel
- run: pip install -r requirements-dev.txt
# Make sure that it doesn't crash with Noto Color Emoji installed
- run: sudo apt install --no-install-recommends fonts-noto-color-emoji tkdnd xvfb
- run: xvfb-run python -m pytest --durations=10

# Separate from other pytests because tkinter doesn't work on macos with actions/setup-python.
# It imports, but gives this error: RuntimeError: tk.h version (8.6) doesn't match libtk.a version (8.5)
Expand All @@ -67,7 +79,7 @@ jobs:
TCLLIBPATH: ./lib
PYTHON: /usr/local/opt/python@${{ matrix.python-version }}/libexec/bin/python
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: brew install python@${{ matrix.python-version }}
# https://stackoverflow.com/a/66919851
- if: matrix.python-version != '3.8'
Expand All @@ -81,8 +93,8 @@ jobs:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8" # last version supporting windows 7
cache: pip
Expand All @@ -20,7 +20,7 @@ jobs:
platform: x64
# -u makes print show in real time
- run: python -u scripts/build-exe-installer.py
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: windows-exe
path: build/PorcupineSetup_*.exe
Expand All @@ -29,8 +29,8 @@ jobs:
#docs:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v4
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: "3.11"
# cache: pip
Expand All @@ -46,12 +46,12 @@ jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: |
# Extract second "## blah" separated part, excluding the "## blah" lines
# https://stackoverflow.com/a/20943815
awk '/^## / { part++ } (part == 1 && line++ != 0) { print }' CHANGELOG.md | tee changelog_part.md
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: changelog
path: changelog_part.md
Expand All @@ -63,10 +63,10 @@ jobs:
needs: [windows-build, changelog]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: windows-exe
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: changelog
- id: get_version
Expand Down

0 comments on commit f007710

Please sign in to comment.