From fb65b13519349626e9736db83be6dc123b3b3ac6 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:29:44 +0100 Subject: [PATCH 01/18] Install Mono --- .github/actions/install-mono/action.yml | 73 +++++++++++++++++++++++++ .github/workflows/ci.yml | 53 +++++++++++------- 2 files changed, 107 insertions(+), 19 deletions(-) create mode 100644 .github/actions/install-mono/action.yml diff --git a/.github/actions/install-mono/action.yml b/.github/actions/install-mono/action.yml new file mode 100644 index 0000000..cee0e6d --- /dev/null +++ b/.github/actions/install-mono/action.yml @@ -0,0 +1,73 @@ +name: 'Install Mono' +description: 'Install Mono' +branding: + icon: package + color: blue +inputs: + arch: + description: Architecture to install for + required: true +runs: + using: "composite" + steps: + - name: Cache on Linux + if: runner.os == 'Linux' + uses: actions/cache@v5 + with: + path: .apt + key: mono-${{ runner.os }}-${{ inputs.arch }} + + - name: Cache on Windows + if: runner.os == 'Windows' + uses: actions/cache@v5 + with: + path: ${{ env.TEMP }}\chocolatey + key: mono-${{ runner.os }}-${{ inputs.arch }} + + # - name: Cache on macOS (x86_64) + # if: runner.os == 'Linux' + # uses: actions/cache@v5 + # with: + # path: .apt + # key: mono-${{ runner.os }}-${{ inputs.arch }} + # + # - name: Cache on macOS (arm64) + # if: runner.os == 'Linux' + # uses: actions/cache@v5 + # with: + # path: .apt + # key: mono-${{ runner.os }}-${{ inputs.arch }} + + # =================================== + + - name: Install on Linux + if: runner.os == 'Linux' + run: | + sudo apt-get -o Dir::Cache=".apt" update + sudo apt-get -o Dir::Cache=".apt" install -y mono-runtime-sgen + shell: sh + + - name: Install on Windows (x86) + if: runner.os == 'Windows' && inputs.arch == 'x86' + run: choco install --x86 -y mono + shell: sh + + - name: Install on Windows + if: runner.os == 'Windows' && inputs.arch != 'x86' + run: choco install -y mono + shell: sh + + - name: Install on macOS (x86_64) + if: runner.os == 'macOS' && inputs.arch == 'x64' + run: | + arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + arch -x86_64 /usr/local/bin/brew install mono + shell: sh + + - name: Install on macOS (arm64) + if: runner.os == 'macOS' && inputs.arch != 'x64' + run: | + brew update + brew install mono + shell: sh + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f38b54b..a86fd12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: run: ruff check test: - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os.instance }} needs: build strategy: fail-fast: false @@ -48,15 +48,39 @@ jobs: # - Install mono via install-package action # - Update macos images to at least 14 as 13 is retired # - Update ubuntu images - os: [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-13] + os: + - category: windows + platform: x64 + instance: windows-latest + suffix: -windows-x86_64-none + + - category: ubuntu + platform: x64 + instance: ubuntu-22.04 + suffix: "" + + - category: ubuntu + platform: arm64 + instance: ubuntu-22.04-arm + suffix: "" + + - category: macos + platform: x64 + instance: macos-15 + suffix: -macos-x86_64-none + + - category: macos + platform: arm64 + instance: macos-15 + suffix: -macos-aarch64-none + python: ['3.14', '3.13', '3.12', '3.11', '3.10'] # pypy3 steps: - - name: Set Environment on macOS - uses: maxim-lobanov/setup-xamarin@v1 - if: ${{ matrix.os.category == 'macos' }} + - name: Install Mono + uses: ./.github/actions/install-mono with: - mono-version: latest + arch: ${{ matrix.os.platform }} - name: Setup .NET uses: actions/setup-dotnet@v5 @@ -66,19 +90,10 @@ jobs: - name: Set up Python ${{ matrix.python }} uses: astral-sh/setup-uv@v7 with: - python-version: ${{ matrix.python }} - - - name: Cache Mono - if: runner.os == 'Windows' - uses: actions/cache@v5 - with: - path: ${{ env.TEMP }}\chocolatey - key: ${{ runner.os }}-chocolatey-${{ matrix.python == 'pypy3' && '32' || '64' }} - - - name: Install Mono - if: runner.os == 'Windows' - run: | - choco install -y mono ${{ matrix.python == 'pypy3' && '--x86' || '' }} + python-version: cpython-${{ matrix.python }}${{ matrix.os.suffix }} + cache-python: true + activate-environment: true + enable-cache: true - uses: actions/checkout@v6 From 47413fe09d3ad35f1798480e8b2d532a27508e9a Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:34:00 +0100 Subject: [PATCH 02/18] Check out first --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a86fd12..571fa9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,8 @@ jobs: python: ['3.14', '3.13', '3.12', '3.11', '3.10'] # pypy3 steps: + - uses: actions/checkout@v6 + - name: Install Mono uses: ./.github/actions/install-mono with: @@ -95,8 +97,6 @@ jobs: activate-environment: true enable-cache: true - - uses: actions/checkout@v6 - - name: Install dependencies run: | uv venv From b485e96e1bac2a8dd98fe76113e63a14a505cd9e Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:37:31 +0100 Subject: [PATCH 03/18] Install .NET for the right platform --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 571fa9a..f50e47b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,6 +88,7 @@ jobs: uses: actions/setup-dotnet@v5 with: dotnet-version: '10.0' + architecture: ${{ matrix.os.platform }} - name: Set up Python ${{ matrix.python }} uses: astral-sh/setup-uv@v7 From 2b627119c3b8fe8c8e115b4a63b4525c8af5d46e Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:39:44 +0100 Subject: [PATCH 04/18] Ensure that .apt exists --- .github/actions/install-mono/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/install-mono/action.yml b/.github/actions/install-mono/action.yml index cee0e6d..9dd1b3a 100644 --- a/.github/actions/install-mono/action.yml +++ b/.github/actions/install-mono/action.yml @@ -43,6 +43,7 @@ runs: - name: Install on Linux if: runner.os == 'Linux' run: | + sudo mkdir .apt sudo apt-get -o Dir::Cache=".apt" update sudo apt-get -o Dir::Cache=".apt" install -y mono-runtime-sgen shell: sh From f98d382596fcf535fc38f6cfde77e0cc29bc8a0f Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:42:57 +0100 Subject: [PATCH 05/18] Maybe fix apt --- .github/actions/install-mono/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/install-mono/action.yml b/.github/actions/install-mono/action.yml index 9dd1b3a..67a8c7e 100644 --- a/.github/actions/install-mono/action.yml +++ b/.github/actions/install-mono/action.yml @@ -43,9 +43,9 @@ runs: - name: Install on Linux if: runner.os == 'Linux' run: | - sudo mkdir .apt - sudo apt-get -o Dir::Cache=".apt" update - sudo apt-get -o Dir::Cache=".apt" install -y mono-runtime-sgen + sudo mkdir -p ./.apt/archives/partial + sudo apt-get -o Dir::Cache="./.apt" update + sudo apt-get -o Dir::Cache="./.apt" install -y mono-runtime-sgen shell: sh - name: Install on Windows (x86) From 33226e6963b3f0a974a6d129ae5f773185ca779a Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:43:59 +0100 Subject: [PATCH 06/18] Bump setup-dotnet --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f50e47b..cf83ddb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,8 @@ jobs: arch: ${{ matrix.os.platform }} - name: Setup .NET - uses: actions/setup-dotnet@v5 + # use most current version until architecture: support is released + uses: actions/setup-dotnet@main with: dotnet-version: '10.0' architecture: ${{ matrix.os.platform }} From b67ebc1a311ef5ac9d7729a9d96c6fb49ec77c98 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:47:13 +0100 Subject: [PATCH 07/18] Disable uv cache in test run --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf83ddb..487ba7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,8 +96,6 @@ jobs: with: python-version: cpython-${{ matrix.python }}${{ matrix.os.suffix }} cache-python: true - activate-environment: true - enable-cache: true - name: Install dependencies run: | From cd0ec2e4e8431722cece0f25f9b3fba5baa0c785 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:49:46 +0100 Subject: [PATCH 08/18] Try --- .github/actions/install-mono/action.yml | 2 +- .github/workflows/ci.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-mono/action.yml b/.github/actions/install-mono/action.yml index 67a8c7e..a224fbb 100644 --- a/.github/actions/install-mono/action.yml +++ b/.github/actions/install-mono/action.yml @@ -43,7 +43,7 @@ runs: - name: Install on Linux if: runner.os == 'Linux' run: | - sudo mkdir -p ./.apt/archives/partial + mkdir -p ./.apt/archives/partial sudo apt-get -o Dir::Cache="./.apt" update sudo apt-get -o Dir::Cache="./.apt" install -y mono-runtime-sgen shell: sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 487ba7a..18e37eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,10 +96,11 @@ jobs: with: python-version: cpython-${{ matrix.python }}${{ matrix.os.suffix }} cache-python: true + activate-environment: true + enable-cache: true - name: Install dependencies run: | - uv venv uv pip install pytest - name: Download wheel From 3d4d7d286f3cc3ae4e9b3fdf967ca2d4154fbe05 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:52:09 +0100 Subject: [PATCH 09/18] Disable uv cache for now --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18e37eb..c5f05ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,9 +95,7 @@ jobs: uses: astral-sh/setup-uv@v7 with: python-version: cpython-${{ matrix.python }}${{ matrix.os.suffix }} - cache-python: true activate-environment: true - enable-cache: true - name: Install dependencies run: | From 639cb309ebfa9ca01180e3ae37793df077317ad9 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 22:54:17 +0100 Subject: [PATCH 10/18] Try --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5f05ec..64a016b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,10 @@ jobs: uses: astral-sh/setup-uv@v7 with: python-version: cpython-${{ matrix.python }}${{ matrix.os.suffix }} + cache-dependency-glob: "" + cache-python: true activate-environment: true + enable-cache: true - name: Install dependencies run: | From 7271602fbbdcbdf3a8224313d6c09809f95714e3 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 23:29:45 +0100 Subject: [PATCH 11/18] Ignore python dependency on mono --- .github/actions/install-mono/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-mono/action.yml b/.github/actions/install-mono/action.yml index a224fbb..20a0a5d 100644 --- a/.github/actions/install-mono/action.yml +++ b/.github/actions/install-mono/action.yml @@ -62,13 +62,13 @@ runs: if: runner.os == 'macOS' && inputs.arch == 'x64' run: | arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - arch -x86_64 /usr/local/bin/brew install mono + arch -x86_64 /usr/local/bin/brew install --ignore-dependencies mono shell: sh - name: Install on macOS (arm64) if: runner.os == 'macOS' && inputs.arch != 'x64' run: | brew update - brew install mono + brew install --ignore-dependencies mono shell: sh From a18abb05abbdffe29e806d74801b00ce65f1953c Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 23:45:15 +0100 Subject: [PATCH 12/18] Use apt cache package and drop cache config again --- .github/actions/install-mono/action.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/actions/install-mono/action.yml b/.github/actions/install-mono/action.yml index 20a0a5d..350e597 100644 --- a/.github/actions/install-mono/action.yml +++ b/.github/actions/install-mono/action.yml @@ -42,11 +42,9 @@ runs: - name: Install on Linux if: runner.os == 'Linux' - run: | - mkdir -p ./.apt/archives/partial - sudo apt-get -o Dir::Cache="./.apt" update - sudo apt-get -o Dir::Cache="./.apt" install -y mono-runtime-sgen - shell: sh + uses: awalsh128/cache-apt-pkgs-action@v1 + with: + packages: mono-runtime-sgen - name: Install on Windows (x86) if: runner.os == 'Windows' && inputs.arch == 'x86' From e48750cf15e35ce22dba816970f6d325c3d7abdd Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Mon, 2 Mar 2026 23:55:58 +0100 Subject: [PATCH 13/18] Run pytest without uv to prevent building --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64a016b..ffdf5a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,6 @@ jobs: uses: astral-sh/setup-uv@v7 with: python-version: cpython-${{ matrix.python }}${{ matrix.os.suffix }} - cache-dependency-glob: "" cache-python: true activate-environment: true enable-cache: true @@ -117,7 +116,7 @@ jobs: - name: Test with pytest run: | - uv run pytest + pytest deploy: runs-on: ubuntu-latest From 298665d00a834b43cfbb9fc06110bd5d73d68b59 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Tue, 3 Mar 2026 00:01:26 +0100 Subject: [PATCH 14/18] Add pypy, drop failing macos versions --- .github/workflows/ci.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffdf5a0..6dffb17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,17 +43,17 @@ jobs: strategy: fail-fast: false matrix: - # macos-13-arm64, windows-11-arm - # TODO: - # - Install mono via install-package action - # - Update macos images to at least 14 as 13 is retired - # - Update ubuntu images os: - category: windows platform: x64 instance: windows-latest suffix: -windows-x86_64-none + - category: windows + platform: x86 + instance: windows-latest + suffix: -windows-x86-none + - category: ubuntu platform: x64 instance: ubuntu-22.04 @@ -74,7 +74,19 @@ jobs: instance: macos-15 suffix: -macos-aarch64-none - python: ['3.14', '3.13', '3.12', '3.11', '3.10'] # pypy3 + python: ['3.14', '3.13', '3.12', '3.11', '3.10', 'pypy3'] + + exclude: + # Broken ctypes find_library + - category: macos + platform: arm64 + python: '3.10' + - category: macos + platform: arm64 + python: '3.11' + - category: macos + platform: arm64 + python: '3.12' steps: - uses: actions/checkout@v6 From 5204cf13bb731fb1c5f469d468a3d42f64e15384 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Tue, 3 Mar 2026 00:04:03 +0100 Subject: [PATCH 15/18] Try --- .github/workflows/ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dffb17..1112cd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,14 +78,17 @@ jobs: exclude: # Broken ctypes find_library - - category: macos - platform: arm64 + - os: + category: macos + platform: arm64 python: '3.10' - - category: macos - platform: arm64 + - os: + category: macos + platform: arm64 python: '3.11' - - category: macos - platform: arm64 + - os: + category: macos + platform: arm64 python: '3.12' steps: From 35fff320344a13664321c949b80e38715cb2e987 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Tue, 3 Mar 2026 00:06:50 +0100 Subject: [PATCH 16/18] Drop pypy3 again --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1112cd7..2a0ed87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,7 @@ jobs: instance: macos-15 suffix: -macos-aarch64-none - python: ['3.14', '3.13', '3.12', '3.11', '3.10', 'pypy3'] + python: ['3.14', '3.13', '3.12', '3.11', '3.10'] exclude: # Broken ctypes find_library From fca671923a7fd0bdcfd0c8ba5d395db4fb4e6d91 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Tue, 3 Mar 2026 00:14:00 +0100 Subject: [PATCH 17/18] Exclusions and remove unneeded cache --- .github/actions/install-mono/action.yml | 7 ------- .github/workflows/ci.yml | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/actions/install-mono/action.yml b/.github/actions/install-mono/action.yml index 350e597..a452952 100644 --- a/.github/actions/install-mono/action.yml +++ b/.github/actions/install-mono/action.yml @@ -10,13 +10,6 @@ inputs: runs: using: "composite" steps: - - name: Cache on Linux - if: runner.os == 'Linux' - uses: actions/cache@v5 - with: - path: .apt - key: mono-${{ runner.os }}-${{ inputs.arch }} - - name: Cache on Windows if: runner.os == 'Windows' uses: actions/cache@v5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a0ed87..c1007a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,6 +91,12 @@ jobs: platform: arm64 python: '3.12' + # Fails to call mono methods + - os: + category: windows + platform: x86 + python: '3.13' + steps: - uses: actions/checkout@v6 From f9eacd1e3414bb055fcc39e970020c7f48efb308 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Tue, 3 Mar 2026 00:37:02 +0100 Subject: [PATCH 18/18] Try to cache --- .github/actions/install-mono/action.yml | 41 ++++++++++++++++--------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/actions/install-mono/action.yml b/.github/actions/install-mono/action.yml index a452952..f414afd 100644 --- a/.github/actions/install-mono/action.yml +++ b/.github/actions/install-mono/action.yml @@ -10,26 +10,35 @@ inputs: runs: using: "composite" steps: + # Windows Cache + - name: Cache setup on Windows + if: runner.os == 'Windows' + run: | + mkdir -p .choco-cache + choco config set cacheLocation $(pwd)/.choco-cache + shell: bash + - name: Cache on Windows if: runner.os == 'Windows' uses: actions/cache@v5 with: - path: ${{ env.TEMP }}\chocolatey + path: .choco-cache key: mono-${{ runner.os }}-${{ inputs.arch }} - # - name: Cache on macOS (x86_64) - # if: runner.os == 'Linux' - # uses: actions/cache@v5 - # with: - # path: .apt - # key: mono-${{ runner.os }}-${{ inputs.arch }} - # - # - name: Cache on macOS (arm64) - # if: runner.os == 'Linux' - # uses: actions/cache@v5 - # with: - # path: .apt - # key: mono-${{ runner.os }}-${{ inputs.arch }} + # macOS Cache + - name: Set Homebrew Cache Path + if: runner.os == 'macOS' + run: | + mkdir -p .brew-cache + echo "HOMEBREW_CACHE=$(pwd)/.brew-cache" >> $GITHUB_ENV + shell: bash + + - name: Cache Homebrew on macOS + if: runner.os == 'macOS' + uses: actions/cache@v5 + with: + path: .brew-cache + key: mono-brew-${{ runner.os }}-${{ inputs.arch }} # =================================== @@ -39,6 +48,8 @@ runs: with: packages: mono-runtime-sgen + # =================================== + - name: Install on Windows (x86) if: runner.os == 'Windows' && inputs.arch == 'x86' run: choco install --x86 -y mono @@ -49,6 +60,8 @@ runs: run: choco install -y mono shell: sh + # =================================== + # - name: Install on macOS (x86_64) if: runner.os == 'macOS' && inputs.arch == 'x64' run: |