Skip to content

Commit f0acdaf

Browse files
committed
Build and test in separate environments
The build environment can use python 3.13, while the test environment uses the python in the matrix.
1 parent 9462346 commit f0acdaf

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

.github/workflows/build_workflow.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ env:
2727
CANCEL_OTHERS: false
2828
PATHS_IGNORE: '["**/README.md", "**/docs/**"]'
2929
PYTHON_VERSION: "3.14"
30+
BUILD_PYTHON_VERSION: "3.13"
3031

3132
jobs:
3233
pre-commit-hooks:
@@ -69,33 +70,34 @@ jobs:
6970
- name: Create Build Environment
7071
uses: mamba-org/setup-micromamba@v2
7172
with:
72-
environment-name: mpas_tools_dev
73+
environment-name: mpas_tools_build
7374
init-shell: bash
7475
condarc: |
7576
channel_priority: strict
7677
channels:
7778
- conda-forge
7879
create-args: >-
79-
python=${{ matrix.python-version }}
80+
python=${{ env.BUILD_PYTHON_VERSION }}
8081
81-
- name: Finalize Build Environment
82+
- name: Build mpas_tools package
8283
run: |
8384
conda install conda conda-build
8485
conda build -m "conda_package/ci/linux_64_python${{ matrix.python-version }}.____cpython.yaml" "conda_package/recipe"
86+
# Add local build channel first for subsequent micromamba usage
87+
micromamba config append channels "$CONDA_PREFIX/conda-bld"
88+
micromamba config append channels conda-forge
8589
86-
- name: Install mpas_tools
90+
- name: Create Test Environment
8791
run: |
88-
conda install -y -c ${CONDA_PREFIX}/conda-bld/ \
89-
mpas_tools python=${{ matrix.python-version }} \
90-
sphinx mock sphinx_rtd_theme
92+
micromamba create -y -n mpas_tools_test \
93+
python=${{ env.BUILD_PYTHON_VERSION }} \
94+
mpas_tools \
95+
sphinx \
96+
mock \
97+
sphinx_rtd_theme
9198
9299
- name: Build Sphinx Docs
93100
run: |
101+
micromamba activate mpas_tools_test
94102
cd conda_package/docs
95103
DOCS_VERSION=test make versioned-html
96-
condarc: |
97-
channel_priority: strict
98-
channels:
99-
- conda-forge
100-
create-args: >-
101-
python=${{ matrix.python-version }}

0 commit comments

Comments
 (0)