@@ -87,34 +87,43 @@ jobs:
8787 python-version : ${{ steps.matrix.outputs.python-version }}
8888 numpy-version : ${{ steps.matrix.outputs.numpy-version }}
8989 os : ${{ steps.matrix.outputs.os }}
90+ include : ${{ steps.matrix.outputs.include }}
91+ include-numpy : ${{ steps.matrix.outputs.include-numpy }}
9092 steps :
9193 - id : matrix
9294 run : |
9395 if ${{ startsWith(github.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' }}; then
9496 echo "python-version=['3.10', 3.11]" >> $GITHUB_OUTPUT
9597 echo "numpy-version=[1.23, 1.24, 1.25, 1.26]" >> $GITHUB_OUTPUT
9698 echo "os=['ubuntu', 'windows']" >> $GITHUB_OUTPUT
99+ include_max=true
97100 else
98101 echo "python-version=['3.10']" >> $GITHUB_OUTPUT
99102 echo "numpy-version=[1.23]" >> $GITHUB_OUTPUT
100103 if ${{ github.ref == 'refs/heads/master' }}; then
101104 echo "os=['ubuntu', 'windows']" >> $GITHUB_OUTPUT
105+ include_max=true
102106 else
103107 echo "os=['ubuntu']" >> $GITHUB_OUTPUT
108+ include_max=false
104109 fi
105110 fi
106- conda :
111+ if $include_max; then
112+ echo "include=[{'python-version': 3.12, 'os': 'ubuntu'}, {'python-version': 3.12, 'os': 'windows'}]" >> $GITHUB_OUTPUT
113+ echo "include-numpy=[{'python-version': 3.12, 'numpy-version': 1.26, 'os': 'ubuntu'}, {'python-version': 3.12, 'numpy-version': 1.26, 'os': 'windows'}]" >> $GITHUB_OUTPUT
114+ else
115+ echo "include=[]" >> $GITHUB_OUTPUT
116+ echo "include-numpy=[]" >> $GITHUB_OUTPUT
117+ fi
118+ conda-build :
107119 defaults : {run: {shell: 'bash -el {0}'}}
108120 runs-on : ${{ matrix.os }}-${{ matrix.os == 'ubuntu' && '22.04' || 'latest' }}
109121 needs : conda-matrix
110122 strategy :
111123 matrix :
112124 python-version : ${{ fromJson(needs.conda-matrix.outputs.python-version) }}
113- numpy-version : ${{ fromJson(needs.conda-matrix.outputs.numpy-version) }}
114125 os : ${{ fromJson(needs.conda-matrix.outputs.os) }}
115- include :
116- - {python-version: 3.12, numpy-version: 1.26, os: ubuntu}
117- - {python-version: 3.12, numpy-version: 1.26, os: windows}
126+ include : ${{ fromJson(needs.conda-matrix.outputs.include) }}
118127 steps :
119128 - uses : actions/checkout@v4
120129 with :
@@ -129,38 +138,67 @@ jobs:
129138 mamba-version : " *"
130139 channels : conda-forge
131140 conda-remove-defaults : " true"
132- - run : conda install boa conda-verify anaconda-client
133- - name : conda build & test
134- working-directory : recipe
135- run : |
136- conda mambabuild . -c conda-forge -c https://tomography.stfc.ac.uk/conda --override-channels --python=${{ matrix.python-version }} --numpy=${{ matrix.numpy-version }} -- output-folder .
141+ - run : conda install boa conda-verify
142+ - name : conda build
143+ run : >
144+ conda mambabuild -c conda-forge -c https://tomography.stfc.ac.uk/conda --override-channels --python=${{ matrix.python-version }}
145+ --no-test -- output-folder dist recipe
137146 - uses : actions/upload-artifact@v4
138147 with :
139- name : cil-package-${{ matrix.os }}-py${{ matrix.python-version }}-np${{ matrix.numpy-version }}
140- path : recipe/*/cil-*.tar.bz2
141- - name : anaconda upload -c ccpi
142- if : >
143- (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')) && matrix.numpy-version == '1.26'
144- run : |
145- anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force --label ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} recipe/*/cil-*.tar.bz2
146- - name : conda upload -c tomography.stfc.ac.uk/conda
147- if : startsWith(github.ref, 'refs/tags')
148- run : |
149- echo '${{ secrets.STFC_SSH_KEY }}' > ./key
150- chmod 600 ./key
151- for plat in linux-64 win-64; do
152- rsync -e 'ssh -o StrictHostKeyChecking=no -i ./key' -P recipe/$plat/cil-*.tar.bz2 \
153- '${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}/$plat/'
154- done
155- conda-reindex :
156- if : startsWith(github.ref, 'refs/tags')
157- needs : conda
148+ name : cil-py${{ matrix.python-version }}-${{ matrix.os }}
149+ path : dist/*/cil-*.tar.bz2
150+ conda-test :
151+ defaults : {run: {shell: 'bash -el {0}'}}
152+ runs-on : ${{ matrix.os }}-${{ matrix.os == 'ubuntu' && '22.04' || 'latest' }}
153+ needs : [conda-matrix, conda-build]
154+ strategy :
155+ matrix :
156+ python-version : ${{ fromJson(needs.conda-matrix.outputs.python-version) }}
157+ numpy-version : ${{ fromJson(needs.conda-matrix.outputs.numpy-version) }}
158+ os : ${{ fromJson(needs.conda-matrix.outputs.os) }}
159+ include : ${{ fromJson(needs.conda-matrix.outputs.include-numpy) }}
160+ steps :
161+ - uses : actions/checkout@v4
162+ - uses : conda-incubator/setup-miniconda@v3
163+ with :
164+ python-version : ${{ matrix.python-version }}
165+ mamba-version : " *"
166+ channels : conda-forge
167+ conda-remove-defaults : " true"
168+ - run : conda install boa
169+ - uses : actions/download-artifact@v4
170+ with :
171+ name : cil-py${{ matrix.python-version }}-${{ matrix.os }}
172+ path : dist
173+ - name : conda test
174+ run : >
175+ conda mambabuild -c conda-forge -c https://tomography.stfc.ac.uk/conda --override-channels --python=${{ matrix.python-version }}
176+ --test dist/*/cil-*.tar.bz2 --extra-deps numpy=${{ matrix.numpy-version }}
177+ conda-upload :
178+ if : github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
179+ defaults : {run: {shell: 'bash -el {0}', working-directory: dist}}
158180 runs-on : ubuntu-22.04
181+ needs : conda-test
159182 steps :
160- - name : conda index tomography.stfc.ac.uk/conda
183+ - uses : actions/checkout@v4
184+ - uses : conda-incubator/setup-miniconda@v3
185+ with :
186+ mamba-version : " *"
187+ channels : conda-forge
188+ conda-remove-defaults : " true"
189+ - uses : actions/download-artifact@v4
190+ with : {pattern: cil-py*-*, path: dist, merge-multiple: true}
191+ - run : conda install anaconda-client
192+ - name : anaconda upload -c ccpi
193+ run : >
194+ anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force
195+ --label ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} */cil-*.tar.bz2
196+ - if : startsWith(github.ref, 'refs/tags')
197+ name : conda upload -c tomography.stfc.ac.uk/conda
161198 run : |
162199 echo '${{ secrets.STFC_SSH_KEY }}' > ./key
163200 chmod 600 ./key
201+ rsync -e 'ssh -o StrictHostKeyChecking=no -i ./key' -R */cil-*.tar.bz2 '${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}'
164202 ssh -o StrictHostKeyChecking=no -i ./key ${{ secrets.STFC_SSH_HOST }} \
165203 'bash -lic "conda index --bz2 --zst --run-exports --channeldata --rss -n ccpi ${{ secrets.STFC_SSH_CONDA_DIR }}"'
166204 docs :
@@ -266,6 +304,6 @@ jobs:
266304 tags : ${{ steps.meta.outputs.tags }}
267305 labels : ${{ steps.meta.outputs.labels }}
268306 pass :
269- needs : [test-cuda, test, conda, docs, docker]
307+ needs : [test-cuda, test, conda-test , docs, docker]
270308 runs-on : ubuntu-22.04
271309 steps : [{run: echo success}]
0 commit comments