Selaa lähdekoodia

CI: Fix broken pip install to use ephemeral virtual environment

Python 3.11 and later support a system-wide configuration setting that
marks the system packages as "externally managed" (e.g. to force using
apt packages instead of pip packages).

This breaks installation of the modules necessary to run the validators,
so use a virtual environment instead.
PatTheMav 1 vuosi sitten
vanhempi
sitoutus
629b60f328

+ 5 - 0
.github/actions/compatibility-validator/action.yaml

@@ -31,6 +31,10 @@ runs:
           echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
         fi
         brew install --quiet python3
+
+        python3 -m venv .venv
+
+        source .venv/bin/activate
         python3 -m pip install jsonschema json_source_map
         echo ::endgroup::
 
@@ -43,6 +47,7 @@ runs:
         shopt -s extglob
 
         echo ::group::Schema Validation
+        source .venv/bin/activate
         python3 -u \
           .github/scripts/utils.py/check-jsonschema.py \
           --loglevel INFO \

+ 8 - 0
.github/actions/services-validator/action.yaml

@@ -53,6 +53,10 @@ runs:
           echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
           brew install --overwrite --quiet python3
         fi
+
+        python3 -m venv .venv
+
+        source .venv/bin/activate
         python3 -m pip install jsonschema json_source_map requests aiohttp
         echo ::endgroup::
 
@@ -66,6 +70,8 @@ runs:
         shopt -s extglob
 
         echo ::group::Run Validation
+
+        source .venv/bin/activate
         python3 -u \
           .github/scripts/utils.py/check-jsonschema.py \
           plugins/rtmp-services/data/@(services|package).json \
@@ -101,6 +107,8 @@ runs:
         API_SERVERS: ${{ inputs.checkApiServers }}
       run: |
         : Check for defunct services 📉
+
+        source .venv/bin/activate
         python3 -u .github/scripts/utils.py/check-services.py
 
     - uses: actions/upload-artifact@v4