Skip to content

Commit ff1df4e

Browse files
authored
Update publish_conda.yml
1 parent c3be617 commit ff1df4e

1 file changed

Lines changed: 48 additions & 11 deletions

File tree

.github/workflows/publish_conda.yml

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,29 @@ permissions:
1313
jobs:
1414
condapublish:
1515
runs-on: ubuntu-latest
16+
1617
defaults:
1718
run:
1819
shell: bash -l {0}
20+
1921
steps:
2022
- name: Checkout Files
2123
uses: actions/checkout@v4
2224
with:
2325
submodules: 'recursive'
2426

25-
- name: Setup Conda
27+
- name: Set up base Miniforge
2628
uses: conda-incubator/setup-miniconda@v3
2729
with:
28-
auto-activate: true
29-
activate-environment: base
30-
conda-remove-defaults: true
3130
miniforge-version: latest
32-
channels: conda-forge,noaa-gfdl
31+
conda-remove-defaults: true
32+
python-version: "3.11"
3333

3434
- name: Configure Conda
3535
run: |
36-
echo "removing main and r channels from defaults"
37-
conda config --remove channels defaults || true
38-
conda config --remove channels main || true
39-
conda config --remove channels r || true
36+
echo "removing conda default channels, appending open-source ones"
37+
conda config --append channels conda-forge
38+
conda config --append channels noaa-gfdl
4039
4140
echo "setting strict channel priority"
4241
conda config --set channel_priority strict
@@ -50,7 +49,6 @@ jobs:
5049
- name: Update Conda and Conda Package Indices
5150
run: |
5251
echo "updating conda and package channel indices for conda-forge, noaa-gfdl"
53-
conda update -y conda
5452
conda update -y --all --override-channels -c conda-forge
5553
conda update -y --all --override-channels -c noaa-gfdl
5654
@@ -63,4 +61,43 @@ jobs:
6361
run: |
6462
echo "conda building fremor package"
6563
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
66-
conda build .
64+
conda build --version
65+
conda build --debug .
66+
67+
# -----------------------------------------------------------------
68+
# Post-publish verification: install epmt from the noaa-gfdl channel
69+
# into a clean environment and run tests against it.
70+
# -----------------------------------------------------------------
71+
- name: Wait for noaa-gfdl channel to update
72+
run: |
73+
echo "Waiting 1 minutes for the noaa-gfdl channel index to update..."
74+
sleep 60
75+
76+
- name: Remove checked-out source code
77+
run: |
78+
echo "Removing workspace source to ensure tests run against the installed package"
79+
rm -rf "$GITHUB_WORKSPACE"/*
80+
ls -la "$GITHUB_WORKSPACE"
81+
82+
- name: Create clean environment and install fremor from noaa-gfdl
83+
run: |
84+
conda create -y -n fremor-verify python=${{ matrix.python-version }}
85+
conda activate fremor-verify
86+
conda install -y -c noaa-gfdl -c conda-forge fremor
87+
conda install -y conda-forge::pytest
88+
conda list -n fremor-verify
89+
90+
- name: Resolve site-packages path
91+
id: site_pkgs
92+
run: |
93+
conda activate fremor-verify
94+
site_pkgs=$(python3 -c 'import site; print(site.getsitepackages()[0]);')
95+
echo "site_pkgs=${site_pkgs}" >> "$GITHUB_OUTPUT"
96+
echo "site-packages path: ${site_pkgs}"
97+
98+
- name: test(s) on package installed from channel
99+
run: |
100+
conda activate fremor-verify
101+
fremor --help
102+
fremor --version
103+
pytest -x -vv ${{ steps.site_pkgs.outputs.site_pkgs }}/fremor/tests

0 commit comments

Comments
 (0)