Skip to content

Commit 7cdd69b

Browse files
committed
Fix build workflow
1 parent 9a8a4ba commit 7cdd69b

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

.github/workflows/build_workflow.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ jobs:
4444
- name: Finalize Build Environment
4545
run: |
4646
conda install -y conda conda-build
47-
conda build -m "recipes/e3sm-unified/configs/mpi_${{ matrix.mpi }}_python${{ matrix.python-version }}.yaml" "recipes/e3sm-unified"
47+
cd recipes/e3sm-unified
48+
./build_packages.py --conda ${CONDA_PREFIX} \
49+
--python ${{ matrix.python-version }} \
50+
--mpi ${{ matrix.mpi }}
4851
4952
- name: Install E3SM-Unified
5053
run: |

recipes/e3sm-unified/build_packages.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@
1515
RELEASE_MPI_VERSIONS = ["nompi", "mpich", "openmpi", "hpc"]
1616

1717

18-
def generate_matrix_files(dev):
18+
def generate_matrix_files(dev, python_versions, mpi_versions):
1919
with open("configs/template.yaml") as f:
2020
template_text = f.read()
2121
template = Template(template_text)
22-
if dev:
23-
python_versions = DEV_PYTHON_VERSIONS
24-
mpi_versions = DEV_MPI_VERSIONS
25-
else:
26-
python_versions = RELEASE_PYTHON_VERSIONS
27-
mpi_versions = RELEASE_MPI_VERSIONS
22+
if python_versions is None:
23+
if dev:
24+
python_versions = DEV_PYTHON_VERSIONS
25+
else:
26+
python_versions = RELEASE_PYTHON_VERSIONS
27+
if mpi_versions is None:
28+
if dev:
29+
mpi_versions = DEV_MPI_VERSIONS
30+
else:
31+
mpi_versions = RELEASE_MPI_VERSIONS
2832
matrix_files = []
2933
for python in python_versions:
3034
for mpi in mpi_versions:
@@ -46,6 +50,16 @@ def main():
4650
default=os.path.expanduser("~/miniforge3"),
4751
help="Path to the conda base directory (default: ~/miniforge3)."
4852
)
53+
parser.add_argument(
54+
"--python",
55+
nargs="+",
56+
help="Python version(s) to build for (overrides default matrix)."
57+
)
58+
parser.add_argument(
59+
"--mpi",
60+
nargs="+",
61+
help="MPI variant(s) to build for (overrides default matrix)."
62+
)
4963
args = parser.parse_args()
5064

5165
conda_dir = os.path.expanduser(args.conda)
@@ -59,7 +73,11 @@ def main():
5973
shutil.rmtree(bld_dir)
6074

6175
# Generate matrix files on the fly
62-
matrix_files = generate_matrix_files(dev)
76+
matrix_files = generate_matrix_files(
77+
dev,
78+
python_versions=args.python,
79+
mpi_versions=args.mpi,
80+
)
6381

6482
dev_labels = []
6583
if dev:

0 commit comments

Comments
 (0)