|
1 | 1 | name: publish_conda |
2 | 2 | on: |
3 | | - pull_request: |
4 | 3 | push: |
5 | 4 | branches: |
6 | 5 | - main |
7 | 6 | tags: |
8 | 7 | - '*' |
9 | 8 |
|
10 | | -permissions: |
11 | | - contents: read |
12 | | - |
13 | 9 | jobs: |
14 | 10 | condapublish: |
15 | 11 | runs-on: ubuntu-latest |
|
21 | 17 | steps: |
22 | 18 | - name: Checkout Files |
23 | 19 | uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + recursive: true |
24 | 22 |
|
25 | 23 | - name: Set up base Miniforge |
26 | 24 | uses: conda-incubator/setup-miniconda@v3 |
|
42 | 40 | echo "printing conda config just in case" |
43 | 41 | conda config --show |
44 | 42 |
|
45 | | - - name: Update Conda and Conda Package Indices |
46 | | - run: | |
47 | | - echo "updating conda and package channel indices for conda-forge, noaa-gfdl" |
48 | | - conda update -y --all --override-channels -c conda-forge |
49 | | - conda update -y --all --override-channels -c noaa-gfdl |
50 | | -
|
51 | 43 | - name: Conda install conda-build |
52 | 44 | run: | |
53 | 45 | echo "conda install conda-build" |
|
80 | 72 | echo "" |
81 | 73 | echo "building conda package for publishing" |
82 | 74 | conda build --no-include-recipe --no-test . |
83 | | -
|
84 | | - # ----------------------------------------------------------------- |
85 | | - # Post-publish verification: install epmt from the noaa-gfdl channel |
86 | | - # into a clean environment and run tests against it. |
87 | | - # ----------------------------------------------------------------- |
88 | | - - name: Wait for noaa-gfdl channel to update |
89 | | - run: | |
90 | | - echo "Waiting 1 minutes for the noaa-gfdl channel index to update..." |
91 | | - sleep 60 |
92 | | -
|
93 | | - - name: Remove checked-out source code |
94 | | - run: | |
95 | | - echo "Removing workspace source to ensure tests run against the installed package" |
96 | | - rm -rf "$GITHUB_WORKSPACE"/* |
97 | | - ls -la "$GITHUB_WORKSPACE" |
98 | | -
|
99 | | - - name: Create clean environment and install fremor from noaa-gfdl |
100 | | - run: | |
101 | | - conda create -y -n fremor-verify |
102 | | - conda activate fremor-verify |
103 | | - conda install -y -c noaa-gfdl -c conda-forge fremor |
104 | | - conda install -y conda-forge::pytest |
105 | | - conda list -n fremor-verify |
106 | | -
|
107 | | - - name: Resolve site-packages path |
108 | | - id: site_pkgs |
109 | | - run: | |
110 | | - conda activate fremor-verify |
111 | | - site_pkgs=$(python3 -c 'import site; print(site.getsitepackages()[0]);') |
112 | | - echo "site_pkgs=${site_pkgs}" >> "$GITHUB_OUTPUT" |
113 | | - echo "site-packages path: ${site_pkgs}" |
114 | | -
|
115 | | - - name: test(s) on package installed from channel |
116 | | - run: | |
117 | | - conda activate fremor-verify |
118 | | - fremor --help |
119 | | - fremor --version |
120 | | - pytest -x -vv ${{ steps.site_pkgs.outputs.site_pkgs }}/fremor/tests |
0 commit comments