debug publish pipeline #56
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: 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 | |
| - name: Set up base Miniforge | |
| uses: conda-incubator/setup-miniconda@v4 | |
| with: | |
| miniforge-version: latest | |
| conda-remove-defaults: true | |
| - 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 | |
| env: | |
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
| run: | | |
| echo "quick sanity check, is the token available as a secret? is the env var set?" | |
| if [ -z "${{ secrets.ANACONDA_TOKEN }}" ]; then | |
| echo "ERROR: ANACONDA_TOKEN is empty or not accessible" | |
| exit 1 | |
| else | |
| echo "ANACONDA_TOKEN is set (length: ${#ANACONDA_API_TOKEN})" | |
| fi | |
| echo "" | |
| echo "sanity check, which shell?" | |
| echo $SHELL | |
| echo "" | |
| echo "printing conda config... again... just in case..." | |
| conda config --show | |
| echo "" | |
| echo "conda build version is" | |
| conda build --version | |
| echo "" | |
| echo "python version" | |
| python --version | |
| echo "" | |
| echo "conda build check" | |
| conda build --debug --check . | |
| echo "" | |
| echo "building conda package for publishing" | |
| CONDA_PKG=$(conda build --debug --output .) | |
| conda build --debug --no-test --token "$ANACONDA_API_TOKEN" . | |
| sleep 5 | |
| echo "" | |
| echo "extra info from additional force-upload step:" | |
| anaconda --verbose upload --force $CONDA_PKG | |
| # ----------------------------------------------------------------- | |
| # 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 | |
| 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 |