Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
add cicd
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo <[email protected]>
  • Loading branch information
pabloaledo committed Jul 13, 2023
1 parent e9e2a20 commit ba75379
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: EEL continuous build
on:
push:
branches:
- '*'
- '!refs/tags/.*'
tags-ignore:
- '*'

jobs:
build:
name: Build EEL
runs-on: self-hosted
timeout-minutes: 90

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check space
run: df -h
- name: Build modified recipe
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
run: source cicd/build_recipes.sh

35 changes: 35 additions & 0 deletions cicd/build_recipes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

setup_conda(){
echo -e "\e[34m Setup conda \e[0m"
(
curl -O https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-$(arch).sh
bash ./Anaconda3-2022.10-Linux-$(arch).sh -b -p $HOME/anaconda3

echo 'export PATH=~/anaconda3/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

~/anaconda3/bin/conda config --system --add channels defaults
~/anaconda3/bin/conda config --system --add channels conda-forge
~/anaconda3/bin/conda config --system --add channels bioconda
~/anaconda3/bin/conda config --system --add channels seqera
)
}

build_recipe(){
echo -e "\e[34m Building recipe $1 \e[0m"
(cd "recipes/$1"; ~/anaconda3/bin/conda build .)
}

[ -e ~/anaconda3 ] || setup_conda

git diff --name-only HEAD^ HEAD | grep '^recipes/' | cut -d/ -f2 | sort | uniq | while read line
do
build_recipe "$line"
done

# create key at https://anaconda.org/<user>/settings/access and put in the env_variable ANACONDA_API_TOKEN
find ~/anaconda3/conda-bld/ -iname '*.tar.bz2' | while read line
do
~/anaconda3/bin/anaconda upload --user seqera --force "$line"
done

0 comments on commit ba75379

Please sign in to comment.