From 7b49029c88b489184a3cd0cf46e50fc919ae5948 Mon Sep 17 00:00:00 2001 From: Gregorio Litenstein Date: Wed, 18 Sep 2024 10:36:49 -0300 Subject: [PATCH] Update GTK stack for use in CI/CD Clarified a little what this commit actually does. --- .github/workflows/cd.yml | 20 +++++++++++++++----- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++---- .github/workflows/docs.yml | 2 +- requirements-tests.txt | 2 +- 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 959b654822..14192cfec6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -16,6 +16,9 @@ on: ref: description: "Enter a tag or commit to package" default: "" + gvsbuild-tag: + description: "Use an alternative gvsbuild release for the windows build. Defaults to latest." + default: "latest" jobs: windows_package: @@ -24,8 +27,8 @@ jobs: strategy: matrix: arch: [x64, x86] - python: ["3.9"] - libtorrent: [2.0.7, 1.2.19] + python: ["3.7", "3.10"] + libtorrent: [2.0.8, 1.2.19] steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -49,12 +52,20 @@ jobs: cache: pip - name: Prepare pip - run: python -m pip install wheel setuptools==68.* + run: python -m pip install wheel setuptools==70.* + + - name: Determine gvsbuild release URL + id: gvsbuild-url + shell: bash + run: | + test -z "${{ github.event.inputs.gvsbuild-tag }}" && tag=latest || tag="${{ github.event.inputs.gvsbuild-tag }}" + if [[ "$tag" == "latest" ]]; then URL="https://github.com/${{ github.repository_owner }}/gvsbuild-release/releases/$tag/download"; else URL="https://github.com/${{ github.repository_owner }}/gvsbuild-release/releases/download/$tag" ; fi + echo "gvsbuild-release-url=$URL" >> $GITHUB_OUTPUT - name: Install GTK run: | $WebClient = New-Object System.Net.WebClient - $WebClient.DownloadFile("https://github.com/deluge-torrent/gvsbuild-release/releases/download/latest/gvsbuild-py${{ matrix.python }}-vs16-${{ matrix.arch }}.zip","C:\GTK.zip") + $WebClient.DownloadFile("${{ steps.gvsbuild-url.outputs.gvsbuild-release-url }}/gvsbuild-py${{ matrix.python-version }}-vs17-${{matrix.arch}}.zip","C:\GTK.zip") 7z x C:\GTK.zip -oc:\GTK echo "C:\GTK\release\lib" | Out-File -FilePath $env:GITHUB_PATH -Append echo "C:\GTK\release\bin" | Out-File -FilePath $env:GITHUB_PATH -Append @@ -77,7 +88,6 @@ jobs: working-directory: deluge_src run: | python -m pip install . - python setup.py install_scripts - name: Freeze Deluge working-directory: packaging/win diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d648ba1dfd..17d4262b23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,13 +10,19 @@ on: core-dump: description: "Set to 1 to enable retrieving core dump from crashes" default: "0" + gvsbuild-tag: + description: "Use an alternative gvsbuild release for the windows build. Defaults to latest." + default: "latest" jobs: test-linux: - runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.7", "3.10"] - + python-version: ["3.9", "3.10"] + os: ["ubuntu-24.04"] + include: + - os: ubuntu-22.04 + python-version: 3.7 + runs-on: ${{ matrix.os }} steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 @@ -36,6 +42,7 @@ jobs: - name: Install dependencies run: | + sudo apt-get install libcairo2-dev libgirepository1.0-dev pip install --upgrade pip wheel setuptools pip install -r requirements-ci.txt pip install -e . @@ -74,7 +81,8 @@ jobs: runs-on: windows-2022 strategy: matrix: - python-version: ["3.7", "3.10"] + python-version: ["3.7", "3.9", "3.10"] + arch: ["x64"] steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -89,6 +97,24 @@ jobs: cache: "pip" cache-dependency-path: "requirements*.txt" + - name: Determine gvsbuild release URL + id: gvsbuild-url + shell: bash + run: | + test -z "${{ github.event.inputs.gvsbuild-tag }}" && tag=latest || tag="${{ github.event.inputs.gvsbuild-tag }}" + if [[ "$tag" == "latest" ]]; then URL="https://github.com/${{ github.repository_owner }}/gvsbuild-release/releases/$tag/download"; else URL="https://github.com/${{ github.repository_owner }}/gvsbuild-release/releases/download/$tag" ; fi + echo "gvsbuild-release-url=$URL" >> $GITHUB_OUTPUT + + - name: Install GTK + run: | + $WebClient = New-Object System.Net.WebClient + $WebClient.DownloadFile("${{ steps.gvsbuild-url.outputs.gvsbuild-release-url }}/gvsbuild-py${{ matrix.python-version }}-vs17-${{matrix.arch}}.zip","C:\GTK.zip") + 7z x C:\GTK.zip -oc:\GTK + echo "C:\GTK\release\lib" | Out-File -FilePath $env:GITHUB_PATH -Append + echo "C:\GTK\release\bin" | Out-File -FilePath $env:GITHUB_PATH -Append + echo "C:\GTK\release" | Out-File -FilePath $env:GITHUB_PATH -Append + python -m pip install --no-index --find-links="C:\GTK\release\python" pycairo PyGObject + - name: Install dependencies run: | pip install --upgrade pip wheel setuptools diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a23e264b81..f6f36e2392 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -29,7 +29,7 @@ jobs: run: | pip install --upgrade pip wheel pip install tox - sudo apt-get install enchant-2 + sudo apt-get install enchant-2 libgirepository1.0-dev - name: Build docs with tox env: diff --git a/requirements-tests.txt b/requirements-tests.txt index 346a27500e..89203f829f 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,4 +1,4 @@ -libtorrent +libtorrent==2.0.7 pytest pytest-twisted pytest-cov