From 61af29fc1504bf72526af3acc1a30a8c7398ee27 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 31 Mar 2024 12:46:18 +0300 Subject: [PATCH 1/7] actions/checkout --- .github/workflows/autofix.yml | 4 ++-- .github/workflows/check.yml | 8 ++++---- .github/workflows/release-builds.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 31d995eab..801d4e2bd 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -11,8 +11,8 @@ 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 }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index caf6a8905..54744e86b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -9,7 +9,7 @@ jobs: mypy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.11" @@ -36,7 +36,7 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11"] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -67,7 +67,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' @@ -81,7 +81,7 @@ jobs: timeout-minutes: 5 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.11" diff --git a/.github/workflows/release-builds.yml b/.github/workflows/release-builds.yml index ce4a6d051..791a7b658 100644 --- a/.github/workflows/release-builds.yml +++ b/.github/workflows/release-builds.yml @@ -8,7 +8,7 @@ jobs: windows-build: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.8" # last version supporting windows 7 @@ -29,7 +29,7 @@ jobs: #docs: # runs-on: ubuntu-latest # steps: - # - uses: actions/checkout@v2 + # - uses: actions/checkout@v4 # - uses: actions/setup-python@v4 # with: # python-version: "3.11" @@ -46,7 +46,7 @@ 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 From a6fdfe641b98ceff2f58f026dff9c4e780028582 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 31 Mar 2024 12:46:52 +0300 Subject: [PATCH 2/7] actions/setup-python --- .github/workflows/autofix.yml | 2 +- .github/workflows/check.yml | 6 +++--- .github/workflows/release-builds.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 801d4e2bd..58ce56bac 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -17,7 +17,7 @@ jobs: 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 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 54744e86b..58c832bb8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" cache: pip @@ -37,7 +37,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: pip @@ -82,7 +82,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" cache: pip diff --git a/.github/workflows/release-builds.yml b/.github/workflows/release-builds.yml index 791a7b658..bce209713 100644 --- a/.github/workflows/release-builds.yml +++ b/.github/workflows/release-builds.yml @@ -9,7 +9,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.8" # last version supporting windows 7 cache: pip @@ -30,7 +30,7 @@ jobs: # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v4 + # - uses: actions/setup-python@v5 # with: # python-version: "3.11" # cache: pip From dc7598894e375c25f13ef51ab51a813645e544f2 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 31 Mar 2024 12:48:45 +0300 Subject: [PATCH 3/7] stefanzweifel/git-auto-commit-action --- .github/workflows/autofix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 58ce56bac..76b2dd514 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -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" From 9739597a06abeb6c3525d113f9e33f0a9fca86d2 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 31 Mar 2024 12:56:10 +0300 Subject: [PATCH 4/7] Get rid of deprecated xvfb action --- .github/workflows/check.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 58c832bb8..03de53c08 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,13 +28,12 @@ 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@v4 - uses: actions/setup-python@v5 @@ -43,16 +42,29 @@ jobs: 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/xvfb-action@v1.4 + - 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) From 5c1f743a829131f046c5d1671a3ad3f449062f73 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 31 Mar 2024 13:00:29 +0300 Subject: [PATCH 5/7] actions/upload-artifact actions/download-artifact --- .github/workflows/release-builds.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-builds.yml b/.github/workflows/release-builds.yml index bce209713..cf88d5397 100644 --- a/.github/workflows/release-builds.yml +++ b/.github/workflows/release-builds.yml @@ -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 @@ -51,7 +51,7 @@ jobs: # 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 @@ -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 From 3ae633c6e95117f4d47df1354981558f568c3c62 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 31 Mar 2024 13:06:41 +0300 Subject: [PATCH 6/7] TEMPORARILY break it on linux to check whether xvfb works --- tests/test_anchors_plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_anchors_plugin.py b/tests/test_anchors_plugin.py index 8cd408e6e..2c886b363 100644 --- a/tests/test_anchors_plugin.py +++ b/tests/test_anchors_plugin.py @@ -7,6 +7,7 @@ def jump_5_times(filetab, how): + assert sys.platform != "linux" locations = [] for i in range(5): get_menu("Edit/Anchors").invoke(how) From 92c3ad29c50f16be15c4645798a26adfff1bb6a9 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sun, 31 Mar 2024 13:11:20 +0300 Subject: [PATCH 7/7] Revert "TEMPORARILY break it on linux to check whether xvfb works" This reverts commit 3ae633c6e95117f4d47df1354981558f568c3c62. --- tests/test_anchors_plugin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_anchors_plugin.py b/tests/test_anchors_plugin.py index 2c886b363..8cd408e6e 100644 --- a/tests/test_anchors_plugin.py +++ b/tests/test_anchors_plugin.py @@ -7,7 +7,6 @@ def jump_5_times(filetab, how): - assert sys.platform != "linux" locations = [] for i in range(5): get_menu("Edit/Anchors").invoke(how)