Skip to content

debug publish pipeline #54

debug publish pipeline

debug publish pipeline #54

Workflow file for this run

name: publish_conda
on:
pull_request:
push:
branches:
- main
tags:
- '*'
permissions:
contents: read
jobs:
condapublish:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout Files
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up base Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
conda-remove-defaults: true
python-version: "3.11"
- name: Configure Conda
run: |
echo "removing conda default channels, appending open-source ones"
conda config --append channels conda-forge
conda config --append channels noaa-gfdl
echo "setting strict channel priority"
conda config --set channel_priority strict
echo "setting anaconda_upload to yes"
conda config --set anaconda_upload yes
echo "printing conda config just in case"
conda config --show
- name: Update Conda and Conda Package Indices
run: |
echo "updating conda and package channel indices for conda-forge, noaa-gfdl"
conda update -y --all --override-channels -c conda-forge
conda update -y --all --override-channels -c noaa-gfdl
- name: Conda install conda-build
run: |
echo "conda install conda-build"
conda install conda-forge::conda-build conda-forge::anaconda-client
- name: Build fremor Conda Package
run: |
echo "conda building fremor package"
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
conda build --version
conda build --debug .
anaconda --verbose upload --force /home/runner/miniconda3/envs/test/conda-bld/noarch/fremor-develop-py_0.conda
# -----------------------------------------------------------------
# Post-publish verification: install epmt from the noaa-gfdl channel
# into a clean environment and run tests against it.
# -----------------------------------------------------------------
- name: Wait for noaa-gfdl channel to update
run: |
echo "Waiting 1 minutes for the noaa-gfdl channel index to update..."
sleep 60
- name: Remove checked-out source code
run: |
echo "Removing workspace source to ensure tests run against the installed package"
rm -rf "$GITHUB_WORKSPACE"/*
ls -la "$GITHUB_WORKSPACE"
- name: Create clean environment and install fremor from noaa-gfdl
run: |
conda create -y -n fremor-verify python=${{ matrix.python-version }}
conda activate fremor-verify
conda install -y -c noaa-gfdl -c conda-forge fremor
conda install -y conda-forge::pytest
conda list -n fremor-verify
- name: Resolve site-packages path
id: site_pkgs
run: |
conda activate fremor-verify
site_pkgs=$(python3 -c 'import site; print(site.getsitepackages()[0]);')
echo "site_pkgs=${site_pkgs}" >> "$GITHUB_OUTPUT"
echo "site-packages path: ${site_pkgs}"
- name: test(s) on package installed from channel
run: |
conda activate fremor-verify
fremor --help
fremor --version
pytest -x -vv ${{ steps.site_pkgs.outputs.site_pkgs }}/fremor/tests