Skip to content

Commit

Permalink
CI: GHA conda build & upload
Browse files Browse the repository at this point in the history
- part of #1870
- related to #1875
- related to #1899 <- #1842 <- #1835
- part of #1598
- related to #1430
- related to #1416
- related to #1205
  • Loading branch information
casperdcl committed Aug 29, 2024
1 parent 4f6e3cf commit 738b7e6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 86 deletions.
47 changes: 28 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Copyright 2021 United Kingdom Research and Innovation
# Copyright 2021 The University of Manchester
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Authors:
# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt
name: build
on:
release:
Expand Down Expand Up @@ -105,8 +92,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
numpy-version: [1.25]
python-version: ['3.10', 3.11]
numpy-version: [1.23, 1.24, 1.25, 1.26]
include:
- python-version: 3.12
numpy-version: 1.26
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -122,12 +112,31 @@ jobs:
working-directory: recipe
run: |
conda install boa
conda mambabuild . -c conda-forge -c https://software.repos.intel.com/python/conda -c ccpi --python=${{ matrix.python-version }} --numpy=${{ matrix.numpy-version }} --output-folder .
- name: Upload artifact of the conda package
uses: actions/upload-artifact@v4
conda mambabuild . -c conda-forge -c https://tomography.stfc.ac.uk/conda --override-channels --python=${{ matrix.python-version }} --numpy=${{ matrix.numpy-version }} --output-folder .
- uses: actions/upload-artifact@v4
with:
name: cil-package
name: cil-package-py${{ matrix.python-version }}-np${{ matrix.numpy-version }}
path: recipe/linux-64/cil*
- name: anaconda upload -c ccpi
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
run: >
anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force --label ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} recipe/linux-64/cil*
- 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
rsync -e 'ssh -i ./key' -P recipe/linux-64/cil* '${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}/linux-64/'
conda-reindex:
if: startsWith(github.ref, 'refs/tags')
needs: conda
runs-on: ubuntu-latest
steps:
- name: conda index tomography.stfc.ac.uk/conda
run: |
echo '${{ secrets.STFC_SSH_KEY }}' > ./key
chmod 600 ./key
ssh -i ./key ${{ secrets.STFC_SSH_HOST }} 'conda index --bz2 --zst --run-exports --channeldata --rss -n ccpi ${{ secrets.STFC_SSH_CONDA_DIR }}'
docs:
defaults: {run: {shell: 'bash -el {0}', working-directory: docs}}
runs-on: ubuntu-latest
Expand Down
43 changes: 0 additions & 43 deletions recipe/conda_build_config.yaml

This file was deleted.

30 changes: 6 additions & 24 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# Copyright 2018 United Kingdom Research and Innovation
# Copyright 2018 The University of Manchester
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Authors:
# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt
# Kyle Pidgeon (UKRI-STFC)

package:
name: cil
# use the latest stable release version
version: {{ environ.get('GIT_DESCRIBE_TAG','v')[1:].split('-')[0] }}

source:
Expand All @@ -33,20 +17,18 @@ build:
test:
requires:
- python-wget
- cvxpy # [ linux ]
- cvxpy # [linux]
- scikit-image
- tomophantom=2.0.0 # [ linux ]
- tomophantom=2.0.0 # [linux]
- tigre=2.6
- packaging
- ccpi-regulariser=24.0.1 # [ not osx ]
- astra-toolbox=2.1=cuda* # [ not osx ]
- ccpi-regulariser=24.0.1 # [not osx]
- astra-toolbox=2.1=cuda* # [not osx]

source_files:
- ./Wrappers/Python/test # [win]
- ./Wrappers/Python/test # [not win]
- ./Wrappers/Python/test

commands:
- python -c "import os; print ('TESTING IN THIS DIRECTORY' , os.getcwd())"
- python -m unittest discover -v -s Wrappers/Python/test # [win]
- python -m unittest discover -s Wrappers/Python/test -v # [not win]

Expand Down Expand Up @@ -98,6 +80,6 @@ requirements:
- ipywidgets

about:
home: https://ccpi.ac.uk/cil
home: https://TomographicImaging.github.io/CIL
license: Apache 2.0 License
summary: 'CCPi Core Imaging Library'

0 comments on commit 738b7e6

Please sign in to comment.