From c69421422eb05ceb1b9fbf85b6af9cb84ea4141b Mon Sep 17 00:00:00 2001 From: Jonathan Giannuzzi Date: Tue, 2 Apr 2024 12:04:57 +0100 Subject: [PATCH] Fix pipx permissions on macOS arm64 in CI --- .github/workflows/python.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index e56dfa9..3047915 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -40,13 +40,17 @@ jobs: with: python-version: ${{ matrix.python-version }} check-latest: true - # pipx is not installed by default on macOS 14 arm64 runners + # pipx currently has permissions issues on macOS 14 arm64 runners # see https://github.com/actions/runner-images/issues/9256 - - name: Install pipx + - name: Fix pipx permissions if: matrix.runner == 'macos-14' run: | - pip install pipx - echo PATH="$(pipx environment -V PIPX_BIN_DIR):$PATH" >> $GITHUB_ENV + for dir in "$PIPX_HOME" "$PIPX_BIN_DIR"; do + if [ -n "$dir" ]; then + sudo mkdir -p "$dir" + sudo chown -R $(id -u) "$dir" + fi + done - name: Test run: pipx run hatch run dev:test working-directory: bindings/python