From d26f801cecc7a87b88ab2687228ce3c540d8e998 Mon Sep 17 00:00:00 2001 From: Elias Müller Date: Mon, 29 Jan 2024 16:52:42 +0100 Subject: Update CI pipeline (#271) * Trigger on pull request * run on ubuntu-latest * run on 3.11 + 3.12 also * upgrade actions * upgrade libmpv * use libmpv-v3 on Windows * disable fail-fast behavior * replace pytest with unittest Using pytest, we run into access violation errors on Windows. They disappear when we use the unittest module. --- .github/workflows/tests.yml | 30 +++++++++++++++++++----------- tests/requirements.txt | 1 - 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8a0d066..52eb072 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,6 +4,8 @@ name: 'Tests' on: push: branches: [ '**' ] + pull_request: + branches: [ '**' ] defaults: @@ -13,19 +15,20 @@ defaults: jobs: test-linux: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest name: 'Linux - Python' strategy: matrix: - python-version: [ '3.8', '3.9', '3.10' ] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] + fail-fast: false env: DISPLAY: :0 PY_MPV_SKIP_TESTS: >- test_wait_for_property_event_overflow steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Install Python' - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: 'Update Packages' @@ -57,30 +60,35 @@ jobs: function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; } execute source venv/bin/activate - execute xvfb-run python -m pytest + execute xvfb-run python -m unittest test-windows: runs-on: windows-latest name: 'Windows - Python' strategy: matrix: - python-version: [ '3.8', '3.9', '3.10' ] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] + fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Install Python' - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: 'Provide libmpv' run: | function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; } - ARTIFACT="mpv-dev-x86_64-20220619-git-c1a46ec.7z" + ARTIFACT="mpv-dev-x86_64-v3-20240121-git-a39f9b6.7z" + SHA1="0764a4b899a7ebb1476e5b491897c5e2eed8a07f" URL="https://sourceforge.net/projects/mpv-player-windows/files/libmpv/$ARTIFACT" execute curl -L -O "$URL" + echo -e "\033[0;34mecho -n $SHA1 $ARTIFACT > $ARTIFACT.sha1\033[0m" + echo -n "$SHA1 $ARTIFACT" > "$ARTIFACT.sha1" + execute sha1sum --check "$ARTIFACT.sha1" execute 7z x "$ARTIFACT" - execute mv mpv-2.dll tests + execute mv libmpv-2.dll tests - name: 'Setup Test Environment' run: | function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; } @@ -95,4 +103,4 @@ jobs: function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; } execute source venv/Scripts/activate - execute python -m pytest + execute python -m unittest diff --git a/tests/requirements.txt b/tests/requirements.txt index ded363c..eabe145 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,2 +1 @@ PyVirtualDisplay>=3.0 -pytest>=7.1.2 -- cgit