Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI/CD to Build Conda Packages #30

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Build Packages

on: pull_request

jobs:
find-recipes:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Get Changed Files
id: changed
uses: jitterbit/get-changed-files@v1
with:
format: "json"

- name: Find recipe.yaml files
id: set-matrix
run: |
changed='${{steps.changed.outputs.added_modified}}'
changed=$(echo $changed | jq -c '{include: [.[] | match("custom-recipes/recipes/([^/]*)/recipe.yaml") | .captures | .[].string | {package: .}]}')
echo "matrix=$changed"
echo "matrix=$changed" >> $GITHUB_OUTPUT

build:
needs: find-recipes
runs-on: ubuntu-latest
container:
image: ghcr.io/european-xfel/environments:main
options: --tmpfs /dev/shm:rw,nosuid,nodev,exec,size=1g
strategy:
matrix: ${{ fromJson(needs.find-recipes.outputs.matrix) }}
name: Build "${{ matrix.package }}"

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Build
run: |
cd custom-recipes
mkdir conda-bld
source /opt/conda/etc/profile.d/conda.sh
conda activate base
./build.sh ${{ matrix.package }}
shell: bash
13 changes: 13 additions & 0 deletions custom-recipes/recipes/damnit/qscintilla-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/pyproject.toml b/pyproject.toml
index a4d321c..b4eefc0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -25,7 +25,7 @@ dependencies = [
"PyQt5",
"PyYAML",
"pyflakes",
- "QScintilla==2.13",
+ "QScintilla==2.13.*",
"xarray",
"scipy",
"supervisor",
72 changes: 72 additions & 0 deletions custom-recipes/recipes/damnit/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
context:
name: damnit
version: '0.1'
branch: 'master'

package:
name: '{{ name|lower }}'
version: '{{ version }}+{{ branch }}'

source:
git_url: https://github.com/European-XFEL/damnit
git_tag: '{{ branch }}'
patches:
- qscintilla-version.patch

build:
entry_points:
- amore-proto = damnit.cli:main
noarch: python
script: '{{ PYTHON }} -m pip install . -vv'
number: 0

requirements:
host:
- python >=3.6
- flit-core >=3.2,<4
- pip
run:
- python >=3.6
- extra-data
- euxfel-bunch-pattern
- h5netcdf
- ipython
- kafka-python
- matplotlib-base
- mplcursors
- mpl-pan-zoom
- numpy
- openpyxl
- pandas <2
- pyqt
- pyyaml
- pyflakes
- qscintilla2 =2.13
- xarray
- scipy
- supervisor
- termcolor
- tomli
- pasha
- extra-geom
- zulip
- tabulate

test:
imports:
- damnit
commands:
- pip check
- amore-proto --help
requires:
- pip

about:
summary: Prototype for extracting and showing metadata (AMORE project)
license: BSD-3-Clause
license_file: LICENSE

extra:
recipe-maintainers:
- RobertRosca

10 changes: 4 additions & 6 deletions custom-recipes/recipes/extra-hed/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ context:
version: 0.1.0

package:
name: '{{ name|lower }}'
version: '{{ version }}'
name: "{{ name|lower }}"
version: "{{ version }}"

source:
path: ./src
# git_url: ssh://[email protected]:10022/tmichela/EXtra-HED.git
git_url: https://git.xfel.eu/tmichela/EXtra-HED.git
git_depth: 1

build:
noarch: python
script: '{{ PYTHON }} -m pip install --no-deps --ignore-installed -vv .'
script: "{{ PYTHON }} -m pip install --no-deps --ignore-installed -vv ."
number: 0

requirements:
Expand Down Expand Up @@ -46,4 +45,3 @@ extra:
notes: Invalid license removed manually
recipe-maintainers:
- RobertRosca

10 changes: 4 additions & 6 deletions custom-recipes/recipes/findxfel/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ context:
version: 0.1.1

package:
name: '{{ name|lower }}'
version: '{{ version }}'
name: "{{ name|lower }}"
version: "{{ version }}"

source:
path: ./src
# git_url: ssh://[email protected]:10022/dataAnalysis/findxfel.git
git_url: https://git.xfel.eu/dataAnalysis/findxfel.git
git_depth: 1

build:
entry_points:
- findxfel = findxfel:main
noarch: python
script: '{{ PYTHON }} -m pip install --no-deps --ignore-installed -vv .'
script: "{{ PYTHON }} -m pip install --no-deps --ignore-installed -vv ."
number: 0

requirements:
Expand Down Expand Up @@ -45,4 +44,3 @@ extra:
notes: "'flit-core' added manually"
recipe-maintainers:
- RobertRosca

12 changes: 5 additions & 7 deletions custom-recipes/recipes/karabo-bridge-recorder/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
context:
name: karabo_bridge_recorder
version: '0.2'
version: "0.2"

package:
name: '{{ name|lower }}'
version: '{{ version }}'
name: "{{ name|lower }}"
version: "{{ version }}"

source:
path: ./src
#git_url: ssh://[email protected]:10022/dataAnalysis/karabo-bridge-recorder.git
git_url: https://git.xfel.eu/dataAnalysis/karabo-bridge-recorder.git
git_depth: 1

build:
entry_points:
- karabo-bridge-record = karabo_bridge_recorder.record:main
- karabo-bridge-replay = karabo_bridge_recorder.replay:main
noarch: python
script: '{{ PYTHON }} -m pip install --no-deps --ignore-installed -vv .'
script: "{{ PYTHON }} -m pip install --no-deps --ignore-installed -vv ."
number: 0

requirements:
Expand Down Expand Up @@ -47,4 +46,3 @@ extra:
notes: "'flit-core' added manually"
recipe-maintainers:
- RobertRosca

10 changes: 4 additions & 6 deletions custom-recipes/recipes/metropc/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ context:
version: 1.4.1

package:
name: '{{ name|lower }}'
version: '{{ version }}'
name: "{{ name|lower }}"
version: "{{ version }}"

source:
path: ./src
# git_url: ssh://[email protected]:10022/karaboDevices/metropc.git
git_url: https://git.xfel.eu/karaboDevices/metropc.git
git_depth: 1

build:
noarch: python
script: '{{ PYTHON }} -m pip install --no-deps --ignore-installed -vv .'
script: "{{ PYTHON }} -m pip install --no-deps --ignore-installed -vv ."
number: 0

requirements:
Expand Down Expand Up @@ -47,4 +46,3 @@ extra:
notes: Invalid license file removed manually
recipe-maintainers:
- RobertRosca

47 changes: 47 additions & 0 deletions custom-recipes/recipes/mpl-pan-zoom/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
context:
name: mpl-pan-zoom
version: 1.0.0

package:
name: '{{ name|lower }}'
version: '{{ version }}'

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/mpl_pan_zoom-{{ version }}.tar.gz
sha256: d3d88592ad8d421040c865b7fc87e7878122d4fa8b8cce72dc09c0decc946764

build:
noarch: python
script: '{{ PYTHON }} -m pip install . -vv'
number: 0

requirements:
host:
- python >=3.7
- setuptools >=45
- wheel
- setuptools-scm >=6.2
- pip
run:
- python >=3.7
- matplotlib-base
- numpy

test:
imports:
- mpl_pan_zoom
commands:
- pip check
requires:
- pip

about:
home: https://github.com/ianhi/mpl-pan-zoom
summary: Panning and zooming with the mouse for matplotlib
license: BSD-3-Clause
license_file: LICENSE

extra:
recipe-maintainers:
- RobertRosca

Loading