diff --git a/.github/workflows/_mac-build.yml b/.github/workflows/_mac-build.yml index a2a5f8dd911..78d675d76af 100644 --- a/.github/workflows/_mac-build.yml +++ b/.github/workflows/_mac-build.yml @@ -152,14 +152,17 @@ jobs: env: OUR_GITHUB_JOB_ID: ${{ steps.get-job-id.outputs.job-id }} run: | - # TODO: Remove me later, and properly activate venv - PATH="$VENV_PATH/bin:$PATH" - export PATH + echo "CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname "$(which conda)")/../"}" >> "${GITHUB_ENV}" + + if [[ -n "$CONDA_ENV" ]]; then + # Use binaries under conda environment + export PATH="$CONDA_ENV/bin":$PATH + fi # NB: Same trick as Linux, there is no need to initialize sccache with the risk of getting # it hangs or timeout at initialization. The cache will be started automatically export SKIP_SCCACHE_INITIALIZATION=1 - .ci/pytorch/macos-build.sh + ${CONDA_RUN} .ci/pytorch/macos-build.sh - name: Archive artifacts into zip if: inputs.build-generates-artifacts && steps.build.outcome != 'skipped' diff --git a/.github/workflows/_mac-test.yml b/.github/workflows/_mac-test.yml index 34fac0acc15..d7ef208da50 100644 --- a/.github/workflows/_mac-test.yml +++ b/.github/workflows/_mac-test.yml @@ -114,12 +114,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Setup Python - uses: pytorch/test-infra/.github/actions/setup-python@main - with: - python-version: ${{ inputs.python-version }} - pip-requirements-file: .github/requirements/pip-requirements-macOS.txt - - name: Start monitoring script id: monitor-script if: ${{ !inputs.disable-monitor }} @@ -132,8 +126,8 @@ jobs: MONITOR_LOG_INTERVAL: ${{ inputs.monitor-log-interval }} MONITOR_DATA_COLLECT_INTERVAL: ${{ inputs.monitor-data-collect-interval }} run: | - $VENV_PATH/bin/python3 -m pip install psutil==5.9.1 dataclasses_json==0.6.7 - $VENV_PATH/bin/python3 -m tools.stats.monitor --log-interval "$MONITOR_LOG_INTERVAL" --data-collect-interval "$MONITOR_DATA_COLLECT_INTERVAL" > usage_log.txt 2>&1 & + python3 -m pip install psutil==5.9.1 dataclasses_json==0.6.7 + python3 -m tools.stats.monitor --log-interval "$MONITOR_LOG_INTERVAL" --data-collect-interval "$MONITOR_DATA_COLLECT_INTERVAL" > usage_log.txt 2>&1 & echo "monitor-script-pid=${!}" >> "${GITHUB_OUTPUT}" - name: Download build artifacts @@ -148,6 +142,13 @@ jobs: with: use-gha: true + - name: Setup Python + uses: pytorch/test-infra/.github/actions/setup-python@main + with: + python-version: ${{ inputs.python-version }} + pip-requirements-file: .github/requirements/pip-requirements-macOS.txt + default-packages: "" + - name: Parse ref id: parse-ref run: .github/scripts/parse_ref.py @@ -198,7 +199,7 @@ jobs: set -ex # TODO: Remove me later, and properly activate venv - PATH="$VENV_PATH/bin:$PATH" + PATH="$(dirname "$(which python)"):$PATH" export PATH # Print out some information about the test environment