Skip to content

Commit 8f70cba

Browse files
committed
build M1 wheel in conda env
1 parent 14093a7 commit 8f70cba

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/wheels.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,32 @@ jobs:
9090
matrix:
9191
python_version: [["3.8", "3.8"], ["3.9", "3.9"], ["3.10", "3.10.3"], ["3.11", "3.11"]]
9292
steps:
93-
- name: Setup Python
94-
uses: actions/setup-python@v2
93+
- name: Setup miniconda (for pytorch_pkg_helpers)
94+
uses: conda-incubator/setup-miniconda@v2.1.1
9595
with:
96-
python-version: ${{ matrix.python_version[1] }}
97-
architecture: x64
96+
miniconda-version: "py39_4.12.0"
97+
python-version: 3.9
98+
- name: Create Conda Environment for Binary Build
99+
run: |
100+
set -euxo pipefail
101+
conda clean --all --quiet --yes
102+
conda create
103+
--yes \
104+
--quiet \
105+
-n buildenv \
106+
python="${matrix.python_version[0]}"
107+
108+
echo "CONDA_RUN=conda run -p buildenv" >> "${GITHUB_ENV}"
98109
- name: Checkout torchrl
99110
uses: actions/checkout@v2
100111
- name: Install PyTorch RC
101112
run: |
102-
python3 -mpip install torch --extra-index-url https://download.pytorch.org/whl/cpu
113+
"${CONDA_RUN}" python3 -mpip install torch --extra-index-url https://download.pytorch.org/whl/cpu
103114
- name: Build wheel
104115
run: |
105-
export CC=clang CXX=clang++
106-
python3 -mpip install wheel
107-
BUILD_VERSION=0.1.1 python3 setup.py bdist_wheel
116+
"${CONDA_RUN}" export CC=clang CXX=clang++
117+
"${CONDA_RUN}" python3 -mpip install wheel
118+
"${CONDA_RUN}" BUILD_VERSION=0.1.1 python3 setup.py bdist_wheel
108119
- name: Upload wheel for the test-wheel job
109120
uses: actions/upload-artifact@v2
110121
with:

0 commit comments

Comments
 (0)