Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 69 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,34 +87,43 @@ jobs:
python-version: ${{ steps.matrix.outputs.python-version }}
numpy-version: ${{ steps.matrix.outputs.numpy-version }}
os: ${{ steps.matrix.outputs.os }}
include: ${{ steps.matrix.outputs.include }}
include-numpy: ${{ steps.matrix.outputs.include-numpy }}
steps:
- id: matrix
run: |
if ${{ startsWith(github.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' }}; then
echo "python-version=['3.10', 3.11]" >> $GITHUB_OUTPUT
echo "numpy-version=[1.23, 1.24, 1.25, 1.26]" >> $GITHUB_OUTPUT
echo "os=['ubuntu', 'windows']" >> $GITHUB_OUTPUT
include_max=true
else
echo "python-version=['3.10']" >> $GITHUB_OUTPUT
echo "numpy-version=[1.23]" >> $GITHUB_OUTPUT
if ${{ github.ref == 'refs/heads/master' }}; then
echo "os=['ubuntu', 'windows']" >> $GITHUB_OUTPUT
include_max=true
else
echo "os=['ubuntu']" >> $GITHUB_OUTPUT
include_max=false
fi
fi
conda:
if $include_max; then
echo "include=[{'python-version': 3.12, 'os': 'ubuntu'}, {'python-version': 3.12, 'os': 'windows'}]" >> $GITHUB_OUTPUT
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
else
echo "include=[]" >> $GITHUB_OUTPUT
echo "include-numpy=[]" >> $GITHUB_OUTPUT
fi
conda-build:
defaults: {run: {shell: 'bash -el {0}'}}
runs-on: ${{ matrix.os }}-${{ matrix.os == 'ubuntu' && '22.04' || 'latest' }}
needs: conda-matrix
strategy:
matrix:
python-version: ${{ fromJson(needs.conda-matrix.outputs.python-version) }}
numpy-version: ${{ fromJson(needs.conda-matrix.outputs.numpy-version) }}
os: ${{ fromJson(needs.conda-matrix.outputs.os) }}
include:
- {python-version: 3.12, numpy-version: 1.26, os: ubuntu}
- {python-version: 3.12, numpy-version: 1.26, os: windows}
include: ${{ fromJson(needs.conda-matrix.outputs.include) }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -129,38 +138,67 @@ jobs:
mamba-version: "*"
channels: conda-forge
conda-remove-defaults: "true"
- run: conda install boa conda-verify anaconda-client
- name: conda build & test
working-directory: recipe
run: |
conda mambabuild . -c conda-forge -c https://tomography.stfc.ac.uk/conda --override-channels --python=${{ matrix.python-version }} --numpy=${{ matrix.numpy-version }} --output-folder .
- run: conda install boa conda-verify
- name: conda build
run: >
conda mambabuild -c conda-forge -c https://tomography.stfc.ac.uk/conda --override-channels --python=${{ matrix.python-version }}
--no-test --output-folder dist recipe
- uses: actions/upload-artifact@v4
with:
name: cil-package-${{ matrix.os }}-py${{ matrix.python-version }}-np${{ matrix.numpy-version }}
path: recipe/*/cil-*.tar.bz2
- name: anaconda upload -c ccpi
if: >
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')) && matrix.numpy-version == '1.26'
run: |
anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force --label ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} recipe/*/cil-*.tar.bz2
- name: conda upload -c tomography.stfc.ac.uk/conda
if: startsWith(github.ref, 'refs/tags')
run: |
echo '${{ secrets.STFC_SSH_KEY }}' > ./key
chmod 600 ./key
for plat in linux-64 win-64; do
rsync -e 'ssh -o StrictHostKeyChecking=no -i ./key' -P recipe/$plat/cil-*.tar.bz2 \
'${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}/$plat/'
done
conda-reindex:
if: startsWith(github.ref, 'refs/tags')
needs: conda
name: cil-py${{ matrix.python-version }}-${{ matrix.os }}
path: dist/*/cil-*.tar.bz2
conda-test:
defaults: {run: {shell: 'bash -el {0}'}}
runs-on: ${{ matrix.os }}-${{ matrix.os == 'ubuntu' && '22.04' || 'latest' }}
needs: [conda-matrix, conda-build]
strategy:
matrix:
python-version: ${{ fromJson(needs.conda-matrix.outputs.python-version) }}
numpy-version: ${{ fromJson(needs.conda-matrix.outputs.numpy-version) }}
os: ${{ fromJson(needs.conda-matrix.outputs.os) }}
include: ${{ fromJson(needs.conda-matrix.outputs.include-numpy) }}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge
conda-remove-defaults: "true"
- run: conda install boa
- uses: actions/download-artifact@v4
with:
name: cil-py${{ matrix.python-version }}-${{ matrix.os }}
path: dist
- name: conda test
run: >
conda mambabuild -c conda-forge -c https://tomography.stfc.ac.uk/conda --override-channels --python=${{ matrix.python-version }}
--test dist/*/cil-*.tar.bz2 --extra-deps numpy=${{ matrix.numpy-version }}
conda-upload:
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
defaults: {run: {shell: 'bash -el {0}', working-directory: dist}}
runs-on: ubuntu-22.04
needs: conda-test
steps:
- name: conda index tomography.stfc.ac.uk/conda
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
mamba-version: "*"
channels: conda-forge
conda-remove-defaults: "true"
- run: conda install anaconda-client
- uses: actions/download-artifact@v4
with: {pattern: cil-py*-*, path: dist, merge-multiple: true}
- name: anaconda upload -c ccpi
run: >
anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force
--label ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} */cil-*.tar.bz2
- if: startsWith(github.ref, 'refs/tags')
name: conda upload -c tomography.stfc.ac.uk/conda
run: |
echo '${{ secrets.STFC_SSH_KEY }}' > ./key
chmod 600 ./key
rsync -e 'ssh -o StrictHostKeyChecking=no -i ./key' -R */cil-*.tar.bz2 '${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}'
ssh -o StrictHostKeyChecking=no -i ./key ${{ secrets.STFC_SSH_HOST }} \
'bash -lic "conda index --bz2 --zst --run-exports --channeldata --rss -n ccpi ${{ secrets.STFC_SSH_CONDA_DIR }}"'
docs:
Expand Down Expand Up @@ -266,6 +304,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
pass:
needs: [test-cuda, test, conda, docs, docker]
needs: [test-cuda, test, conda-test, docs, docker]
runs-on: ubuntu-22.04
steps: [{run: echo success}]
24 changes: 0 additions & 24 deletions recipe/conda_build_config.yaml

This file was deleted.

7 changes: 4 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ build:

test:
requires:
- python
- pip
- python-wget
- cvxpy # [linux]
Expand All @@ -31,6 +30,8 @@ test:
- pip install unittest-parametrize
- python -m unittest discover -v -s Wrappers/Python/test

{% set ipp_version = '2021.12' %}

requirements:
build:
- cmake >=3.16
Expand All @@ -42,14 +43,14 @@ requirements:
- llvm-openmp # [osx]
- ipp-include {{ ipp_version }}
- ipp-devel {{ ipp_version }}
- python >=3.10,<3.13
- python x.x
- pip
- setuptools >=64
- setuptools_scm >=8
- scikit-build-core >=0.10

run:
- python
- {{ pin_compatible('python', min_pin='x.x') }}
- ipp {{ ipp_version }}
- numpy >=1.23,<2
- scipy >=1.4
Expand Down
3 changes: 1 addition & 2 deletions scripts/requirements-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ channels:
- nvidia
- https://software.repos.intel.com/python/conda
dependencies:
# base (vis. recipe/conda_build_config.yaml)
- python >=3.10,<3.13
- python >=3.10
- numpy >=1.23,<2
- ccpi::cil-data >=22
- ccpi::tigre 2.6
Expand Down
3 changes: 1 addition & 2 deletions scripts/requirements-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ channels:
- nvidia
- https://software.repos.intel.com/python/conda
dependencies:
# base (vis. recipe/conda_build_config.yaml)
- python >=3.10,<3.13
- python >=3.10
- numpy >=1.23,<2
- libgomp # [linux]
- ccpi::cil-data >=22
Expand Down
Loading