CMOR Nightly Build #250
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CMOR Nightly Build | |
| run-name: CMOR Nightly Build | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| branches: | |
| - "main" | |
| jobs: | |
| nightly: | |
| name: Deploy nightly | |
| strategy: | |
| matrix: | |
| runner: | |
| - RUNNER_OS: 'macos-14' | |
| OS: osx-arm64 | |
| OS_NAME: osx_arm64 | |
| MINIFORGE_INSTALLER_URL: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh | |
| C_COMPILER: clang_osx-arm64 | |
| FORTRAN_COMPILER: gfortran_osx-arm64 | |
| PROJECT_DIR: workdir/macos_arm64 | |
| - RUNNER_OS: 'macos-15-intel' | |
| OS: osx-64 | |
| OS_NAME: osx_64 | |
| MINIFORGE_INSTALLER_URL: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh | |
| C_COMPILER: clang_osx-64 | |
| FORTRAN_COMPILER: gfortran_osx-64 | |
| PROJECT_DIR: workdir/macos_64 | |
| python_version: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| runs-on: ${{ matrix.runner.RUNNER_OS }} | |
| env: | |
| PACKAGE_NAME: cmor | |
| PACKAGE_VERSION: 3.13.1 | |
| PYTHON_VERSION: ${{ matrix.python_version }} | |
| CONDA_FORGE_CHANNEL: conda-forge | |
| CONDA_USER: pcmdi | |
| CONDA_LABEL: nightly | |
| OS: ${{ matrix.runner.OS }} | |
| OS_NAME: ${{ matrix.runner.OS_NAME }} | |
| MINIFORGE_INSTALLER_URL: ${{ matrix.runner.MINIFORGE_INSTALLER_URL }} | |
| C_COMPILER: ${{ matrix.runner.C_COMPILER }} | |
| FORTRAN_COMPILER: ${{ matrix.runner.FORTRAN_COMPILER }} | |
| PROJECT_DIR: ${{ matrix.runner.PROJECT_DIR }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Pull Submodules | |
| run: | | |
| git submodule init | |
| git submodule update | |
| - name: Setup project directory | |
| run: mkdir -p $PROJECT_DIR | |
| - name: Setup Miniforge | |
| run: | | |
| curl -L $MINIFORGE_INSTALLER_URL -o miniforge3.sh | |
| bash miniforge3.sh -b -p $HOME/miniforge3 | |
| source $HOME/miniforge3/etc/profile.d/conda.sh | |
| eval "$(mamba shell hook --shell bash)" | |
| mamba activate | |
| - name: Conda Rerender | |
| run: | | |
| source $HOME/miniforge3/etc/profile.d/conda.sh | |
| eval "$(mamba shell hook --shell bash)" | |
| mamba activate | |
| git clone -b main https://github.com/conda-forge/cmor-feedstock $PROJECT_DIR/cmor-feedstock | |
| export SRC_META_YAML=`pwd`/$PROJECT_DIR/cmor-feedstock/recipe/meta.yaml.SRC | |
| export DST_META_YAML=`pwd`/$PROJECT_DIR/cmor-feedstock/recipe/meta.yaml | |
| mv $DST_META_YAML $SRC_META_YAML | |
| export GIT_REV=$(git rev-parse --short "$GITHUB_SHA") | |
| echo "GIT_REV=$GIT_REV" | |
| export GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | |
| echo "GIT_BRANCH=$GIT_BRANCH" | |
| python ./ci-support/rebuild_meta_yaml.py \ | |
| --package_name $PACKAGE_NAME \ | |
| --version $PACKAGE_VERSION \ | |
| --organization PCMDI \ | |
| --local_repo `pwd` \ | |
| --git_rev $GIT_REV \ | |
| --build 0 \ | |
| --src_meta_yaml $SRC_META_YAML \ | |
| --dst_meta_yaml $DST_META_YAML | |
| mamba create -y -n smithy_env -c conda-forge conda-smithy | |
| mamba activate smithy_env | |
| cp ./ci-support/autoconf-workaround.patch $PROJECT_DIR/cmor-feedstock | |
| cd $PROJECT_DIR/cmor-feedstock | |
| git apply autoconf-workaround.patch | |
| mamba run conda smithy rerender | |
| ls -lh .ci_support/ | |
| - name: Conda Build | |
| run: | | |
| source $HOME/miniforge3/etc/profile.d/conda.sh | |
| eval "$(mamba shell hook --shell bash)" | |
| mamba activate | |
| mamba activate smithy_env | |
| export BUILD_DIR=$HOME/cmor_conda_pkgs | |
| mkdir -p $BUILD_DIR | |
| export ARTIFACT_DIR=`pwd`/artifacts/$OS | |
| mkdir -p $ARTIFACT_DIR | |
| for i in ${PROJECT_DIR}'/cmor-feedstock/.ci_support/'${OS_NAME}'_*python'${PYTHON_VERSION}'*.yaml'; do | |
| mamba run conda build -c conda-forge --output-folder $BUILD_DIR -m $i $PROJECT_DIR/cmor-feedstock/recipe/ | |
| ls -lh $BUILD_DIR | |
| cp $BUILD_DIR/$OS/$PACKAGE_NAME-$PACKAGE_VERSION*.conda $ARTIFACT_DIR | |
| done | |
| - name: Run Tests | |
| run: | | |
| source $HOME/miniforge3/etc/profile.d/conda.sh | |
| eval "$(mamba shell hook --shell bash)" | |
| mamba activate | |
| export CMOR_CHANNEL=file://$HOME/cmor_conda_pkgs/ | |
| mamba create -y -n test_py$PYTHON_VERSION -c $CMOR_CHANNEL -c $CONDA_FORGE_CHANNEL $CMOR_CHANNEL::$PACKAGE_NAME=$PACKAGE_VERSION python=$PYTHON_VERSION $C_COMPILER $FORTRAN_COMPILER pyfive | |
| mamba activate test_py$PYTHON_VERSION | |
| ./configure --prefix=$CONDA_PREFIX --with-python --with-uuid=$CONDA_PREFIX --with-json-c=$CONDA_PREFIX --with-udunits2=$CONDA_PREFIX --with-netcdf=$CONDA_PREFIX --enable-verbose-test | |
| make test -o cmor -o python | |
| - name: Conda Upload | |
| env: | |
| CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }} | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| run: | | |
| source $HOME/miniforge3/etc/profile.d/conda.sh | |
| eval "$(mamba shell hook --shell bash)" | |
| mamba activate | |
| mamba install -n base -c conda-forge anaconda-client | |
| export ARTIFACT_DIR=`pwd`/artifacts | |
| anaconda -t $CONDA_UPLOAD_TOKEN upload -u $CONDA_USER -l $CONDA_LABEL $ARTIFACT_DIR/*/*.conda --force | |