@@ -323,3 +323,157 @@ jobs:
323323 run : |
324324 conda activate ${{ env.TEST_ENV_NAME }}
325325 pytest -v --pyargs ${{ env.MODULE_NAME }}
326+
327+ build_osx :
328+ runs-on : macos-26-intel
329+ strategy :
330+ matrix :
331+ include :
332+ - python : " 3.10"
333+ numpy : " 2.2"
334+ - python : " 3.11"
335+ numpy : " 2.3"
336+ - python : " 3.12"
337+ numpy : " 2.3"
338+ - python : " 3.13"
339+ numpy : " 2.3"
340+ - python : " 3.14"
341+ numpy : " 2.3"
342+
343+ steps :
344+ - name : Cancel Previous Runs
345+ uses : styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # v0.13.1
346+ with :
347+ access_token : ${{ github.token }}
348+
349+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
350+ with :
351+ fetch-depth : 0
352+
353+ - uses : conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
354+ with :
355+ miniforge-version : latest
356+ activate-environment : build
357+ channels : conda-forge
358+ python-version : ${{ matrix.python }}
359+
360+ - name : Cache conda packages
361+ uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
362+ env :
363+ CACHE_NUMBER : 0 # Increase to reset cache
364+ with :
365+ path : /Users/runner/conda_pkgs_dir
366+ key :
367+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
368+ restore-keys : |
369+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
370+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
371+
372+ - name : Install conda-build
373+ shell : bash -el {0}
374+ run : |
375+ conda install -n base -y conda-build
376+ conda list -n base
377+
378+ - name : Store conda paths as envs
379+ shell : bash -el {0}
380+ run : |
381+ echo "CONDA_BLD=$CONDA/conda-bld/osx-64/" >> "$GITHUB_ENV"
382+
383+ - name : Build conda package
384+ shell : bash -el {0}
385+ run : |
386+ CHANNELS=(-c conda-forge --override-channels)
387+ VERSIONS=(--python "${{ matrix.python }}" --numpy "${{ matrix.numpy }}")
388+ TEST=(--no-test)
389+
390+ conda build \
391+ "${TEST[@]}" \
392+ "${VERSIONS[@]}" \
393+ "${CHANNELS[@]}" \
394+ conda-recipe-cf
395+
396+ - name : Upload artifact
397+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
398+ with :
399+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
400+ path : ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda
401+
402+ test_osx :
403+ needs : build_osx
404+ runs-on : macos-26-intel
405+ strategy :
406+ matrix :
407+ include :
408+ - python : " 3.10"
409+ numpy : " 2.2"
410+ - python : " 3.11"
411+ numpy : " 2.3"
412+ - python : " 3.12"
413+ numpy : " 2.3"
414+ - python : " 3.13"
415+ numpy : " 2.3"
416+ - python : " 3.14"
417+ numpy : " 2.3"
418+
419+ steps :
420+ - name : Download artifact
421+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
422+ with :
423+ name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
424+
425+ - uses : conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
426+ with :
427+ miniforge-version : latest
428+ channels : conda-forge
429+ activate-environment : base
430+
431+ - name : Install conda-index
432+ shell : bash -el {0}
433+ run : conda install -n base -y conda-index
434+
435+ - name : Create conda channel
436+ shell : bash -el {0}
437+ run : |
438+ mkdir -p "$GITHUB_WORKSPACE/channel/osx-64"
439+ conda index "$GITHUB_WORKSPACE/channel" || exit 1
440+ mv "${PACKAGE_NAME}"-*.conda "$GITHUB_WORKSPACE/channel/osx-64" || exit 1
441+ conda index "$GITHUB_WORKSPACE/channel" || exit 1
442+ # Test channel
443+ conda search "$PACKAGE_NAME" -c "$GITHUB_WORKSPACE/channel" --override-channels --info --json > "$GITHUB_WORKSPACE/ver.json"
444+ cat ver.json
445+
446+ - name : Collect dependencies
447+ shell : bash -el {0}
448+ run : |
449+ PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")"
450+ export PACKAGE_VERSION
451+ conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" "python=${{ matrix.python }}" "numpy=${{ matrix.numpy }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels --only-deps --dry-run > lockfile
452+ cat lockfile
453+
454+ - name : Cache conda packages
455+ uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
456+ env :
457+ CACHE_NUMBER : 0 # Increase to reset cache
458+ with :
459+ path : /Users/runner/conda_pkgs_dir
460+ key :
461+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
462+ restore-keys : |
463+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
464+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
465+
466+ - name : Install mkl_random
467+ shell : bash -el {0}
468+ run : |
469+ PACKAGE_VERSION="$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")"
470+ export PACKAGE_VERSION
471+ conda create -n "${{ env.TEST_ENV_NAME }}" "${PACKAGE_NAME}=${PACKAGE_VERSION}" pytest "python=${{ matrix.python }}" "numpy=${{ matrix.numpy }}" -c "$GITHUB_WORKSPACE/channel" -c conda-forge --override-channels
472+ # Test installed packages
473+ conda list -n "${{ env.TEST_ENV_NAME }}"
474+
475+ - name : Run tests
476+ shell : bash -el {0}
477+ run : |
478+ conda activate ${{ env.TEST_ENV_NAME }}
479+ pytest -vv --pyargs ${{ env.MODULE_NAME }}
0 commit comments