-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (76 loc) · 3.13 KB
/
buildPlugin.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Name of the GitHub Action
name: Build scipion-em-xmipp on Pull Request
# Specify when the Action should be triggered: when a pull request is opened against the 'devel' or 'master' branch
on:
pull_request:
branches: [devel, master]
# Define the job that should be run
jobs:
build:
# Specify the machine to run the job on
runs-on: ubuntu-22.04
# Define the steps to be taken in the job
steps:
# Installing dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libfftw3-dev libopenmpi-dev openmpi-bin libhdf5-dev python3-numpy python3-dev libtiff5-dev unzip libsqlite3-dev default-jdk git cmake libopencv-dev libopenmpi-dev make cmake
# Installing CUDA
- name: Install CUDA
uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: '11.7.0'
linux-local-args: '[ "--toolkit" ]'
# Installing Miniconda
- name: Install Miniconda
working-directory: ${{ github.workspace }}/../
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p ${{ github.workspace }}/../miniconda/
source ./miniconda/etc/profile.d/conda.sh
conda update -n base -c defaults conda -y
# Installing Scipion
- name: Install Scipion with dependencies
working-directory: ${{ github.workspace }}/../
run: |
eval "$(${{ github.workspace }}/../miniconda/bin/conda shell.bash hook)"
pip3 install --user scipion-installer
python3 -m scipioninstaller -conda -noXmipp -noAsk scipion
# Installing Xmipp's Python dependencies in scipion conda enviroment
- name: Install scons in scipion enviroment
run: |
eval "$(${{ github.workspace }}/../miniconda/bin/conda shell.bash hook)"
conda activate scipion3
pip install scons
# Cloning Xmipp
- name: Cloning Xmipp
working-directory: ${{ github.workspace }}/../
run: git clone https://github.com/I2PC/xmipp.git
# Checkout Xmipp to Pull Request branch if exists, by default stays in devel
- name: Conditionally checkout Xmipp to ${{ github.head_ref }}
working-directory: ${{ github.workspace }}/../xmipp
env:
BRANCH_NAME: ${{ github.head_ref }}
run: |
if [ $(git ls-remote --heads https://github.com/I2PC/xmipp.git $BRANCH_NAME | wc -l) -eq 1 ]; then
git checkout $BRANCH_NAME
fi
# Installing Xmipp
- name: Compile Xmipp and show log
working-directory: ${{ github.workspace }}/../xmipp
env:
BUILD_TESTS: True
run: |
../scipion/scipion3 run ./xmipp
cat compileLOG.txt
# Check out the repository in the pull request
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
# Install plugin from the pull request using the Scipion3 installp command
- name: Install plugin from pull request
working-directory: ${{ github.workspace }}
run: ../scipion/scipion3 installp -p . --devel --noBin