diff --git a/.github/workflows/hosted_runners.yml b/.github/workflows/hosted_runners.yml index 1be49964dda..df17ddc65ab 100644 --- a/.github/workflows/hosted_runners.yml +++ b/.github/workflows/hosted_runners.yml @@ -658,20 +658,22 @@ jobs: coreutils \ gnu-sed + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + architecture: 'x64' + - name: Install tests dependencies id: install_test_deps run: | - python_root="/usr/local/Frameworks/Python.framework/Versions/Current" - - ${python_root}/bin/pip3 install setuptools \ - pexpect==3.3 \ - psutil \ - timeout_decorator \ - six \ - thrift==0.11.0 \ - osquery - - echo "PYTHON_ROOT=${python_root}" >> $GITHUB_OUTPUT + pip3 install setuptools \ + pexpect==3.3 \ + psutil \ + timeout_decorator \ + six \ + thrift==0.11.0 \ + osquery - name: Install CMake shell: bash @@ -721,7 +723,6 @@ jobs: -DCMAKE_BUILD_TYPE:STRING="${{ matrix.build_type }}" \ -DOSQUERY_BUILD_TESTS=ON \ -DOSQUERY_NO_DEBUG_SYMBOLS=${{ steps.debug_symbols_settings.outputs.VALUE }} \ - -DPython3_ROOT_DIR=${{ steps.install_test_deps.outputs.PYTHON_ROOT }} \ ${{ steps.build_paths.outputs.SOURCE }} - name: Build the project @@ -823,17 +824,22 @@ jobs: with: name: macos_tests_Debug + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + architecture: 'x64' + - name: Install tests dependencies + id: install_test_deps run: | - python_root="/usr/local/Frameworks/Python.framework/Versions/Current" - - ${python_root}/bin/pip3 install setuptools \ - pexpect==3.3 \ - psutil \ - timeout_decorator \ - six \ - thrift==0.11.0 \ - osquery + pip3 install setuptools \ + pexpect==3.3 \ + psutil \ + timeout_decorator \ + six \ + thrift==0.11.0 \ + osquery - name: Install CMake shell: bash diff --git a/tools/ci/scripts/macos/package_tests.sh b/tools/ci/scripts/macos/package_tests.sh index 455d94509f4..65cfade46c0 100755 --- a/tools/ci/scripts/macos/package_tests.sh +++ b/tools/ci/scripts/macos/package_tests.sh @@ -29,7 +29,7 @@ main() { local launcher_path="${destination}/run.sh" printf '#!/usr/bin/env bash\n\n' > "${launcher_path}" - printf 'export _OSQUERY_PYTHON_INTERPRETER_PATH="/usr/local/Frameworks/Python.framework/Versions/Current/bin/python3"\n' >> "${launcher_path}" + printf 'export _OSQUERY_PYTHON_INTERPRETER_PATH=`where python`\n' >> "${launcher_path}" printf 'export RUNNER_ROOT_FOLDER="$(pwd)"\n\n' >> "${launcher_path}" printf 'ctest --build-nocmake -V\n' >> "${launcher_path}" chmod 755 "${launcher_path}" || return 1