From 03b0e418805e8d36730682119aa80cf8c16168f0 Mon Sep 17 00:00:00 2001 From: Chris Andreae Date: Wed, 24 Jul 2024 16:16:44 +0900 Subject: [PATCH] Patch metadata-validation Github action: use external python The upstream hardware-metadata-validation action presently fails to install Python dependencies with a permissions error for the pip cache directory. Until it's fixed upstream, patch the action to use Github's `setup-python` and a virtualenv to obtain a functioning Python enviroment. --- .github/workflows/hardware-metadata-validation.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/hardware-metadata-validation.yml b/.github/workflows/hardware-metadata-validation.yml index 716cd976277..8a75d3d2eae 100644 --- a/.github/workflows/hardware-metadata-validation.yml +++ b/.github/workflows/hardware-metadata-validation.yml @@ -21,6 +21,18 @@ jobs: image: docker.io/zmkfirmware/zmk-dev-arm:3.5 steps: - uses: actions/checkout@v4 + - name: Take ownership of /github/home (temporary patch) + run: chown -R $(whoami) /github/home + - name: Install python environment (temporary patch) + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Setup Python virtual environment (temporary patch) + run: | + python3 -m venv /tmp/venv + source /tmp/venv/bin/activate + echo VIRTUAL_ENV="$VIRTUAL_ENV" >> $GITHUB_ENV + echo PATH="$PATH" >> $GITHUB_ENV - name: Install dependencies run: pip install -r app/scripts/requirements.txt - name: West init