Skip to content

Commit e6762e2

Browse files
committed
ci: use conda-incubator/setup-miniconda action
The conda CI jobs are failing. And Windows has been busted for a while. Let's just use the official action for setting up Conda to hopefully pave over problems.
1 parent acf746b commit e6762e2

2 files changed

Lines changed: 38 additions & 26 deletions

File tree

.github/workflows/anaconda.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- '3.11'
2020
- '3.12'
2121
- '3.13'
22+
- '3.14'
2223
runs-on: 'ubuntu-24.04'
2324
env:
2425
# Enable fuzzing tests, other expensive tests.
@@ -37,20 +38,22 @@ jobs:
3738
with:
3839
persist-credentials: false
3940

40-
- name: Create Anaconda Environment
41-
run: |
42-
$CONDA/bin/conda create --yes --quiet --name env python=${{ matrix.py }}
41+
- name: Setup Miniconda and Create Environment
42+
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
43+
with:
44+
activate-environment: env
45+
python-version: "${{ matrix.py }}"
46+
channels: conda-forge,defaults
4347

4448
- name: Install Dependencies
4549
run: |
46-
source $CONDA/bin/activate env
47-
$CONDA/bin/conda install --yes --quiet --name env conda-build pip
50+
conda install --yes --quiet --name base conda-build
51+
conda install --yes --quiet --name env pip
4852
pip install --require-hashes -r ci/requirements.txt
4953
5054
- name: Build and Test
5155
run: |
52-
source $CONDA/bin/activate env
53-
$CONDA/bin/conda build ci/conda
56+
conda build ci/conda
5457
python ci/copy-conda-package.py
5558
5659
- name: Upload Package
@@ -68,6 +71,7 @@ jobs:
6871
- '3.11'
6972
- '3.12'
7073
- '3.13'
74+
- '3.14'
7175
runs-on: 'windows-2022'
7276
env:
7377
# Enable fuzzing tests, other expensive tests.
@@ -86,21 +90,23 @@ jobs:
8690
with:
8791
persist-credentials: false
8892

89-
- name: Create Anaconda Environment
90-
run: |
91-
C:\Miniconda\condabin\conda.bat create --yes --quiet --name env python=${{ matrix.py }}
93+
- name: Setup Miniconda and Create Environment
94+
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
95+
with:
96+
activate-environment: env
97+
python-version: "${{ matrix.py }}"
98+
channels: conda-forge,defaults
9299

93100
- name: Install Dependencies
94101
run: |
95-
C:\Miniconda\condabin\conda.bat install --yes --quiet --name env conda-build pip
96-
C:\Miniconda\envs\env\python.exe -m pip install --user --require-hashes -r ci/requirements.txt
102+
conda install --yes --quiet --name base conda-build
103+
conda install --yes --quiet --name env pip
104+
python -m pip install --user --require-hashes -r ci/requirements.txt
97105
98-
# Disabled because we appear to be hitting https://github.com/conda/conda-build/issues/4835
99-
# and we're not sure how to work around.
100-
#- name: Build and Test
101-
# run: |
102-
# C:\Miniconda\envs\env\Scripts\conda-build.exe ci/conda
103-
# C:\Miniconda\envs\env\python.exe ci/copy-conda-package.py
106+
- name: Build and Test
107+
run: |
108+
conda build ci/conda
109+
python ci/copy-conda-package.py
104110
105111
- name: Upload Package
106112
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

ci/copy-conda-package.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
import os
2+
import platform
23
import shutil
34

4-
from conda_build.config import Config
5+
if platform.system() == "Linux":
6+
build_dir = "/usr/share/miniconda/conda-bld"
7+
elif platform.system() == "Windows":
8+
build_dir = "C:/Miniconda/conda-bld"
9+
else:
10+
raise Exception("Unsupported platform: %s", platform.system())
511

6-
build_dir = Config().bldpkgs_dir
712
dest_dir = "dist"
813

914
if not os.path.exists(dest_dir):
1015
os.mkdir(dest_dir)
1116

1217
print("scanning %s for packages" % build_dir)
13-
for p in os.listdir(build_dir):
14-
if not p.endswith(".conda"):
15-
continue
18+
for root, _, files in os.walk(build_dir):
19+
for f in files:
20+
source = os.path.join(root, f)
21+
if not source.endswith(".conda"):
22+
continue
1623

17-
source = os.path.join(build_dir, p)
18-
print("copying %s" % source)
19-
shutil.copyfile(source, os.path.join(dest_dir, p))
24+
print("copying %s" % source)
25+
shutil.copyfile(source, os.path.join(dest_dir, f))

0 commit comments

Comments
 (0)