Skip to content
Open

Tests #201

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
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
# Name of the GitHub Action
name: Build scipion-em-xmipptomo on Pull Request
name: Build & test plugin

# 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
runs-on: ubuntu-24.04

# Avoid send statistics
env:
SEND_INSTALLATION_STATISTICS: "False"

# Define the steps to be taken in the job
steps:
- name: Free Disk Space (Ubuntu only)
uses: jlumbroso/free-disk-space@main

- name: Set up MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: 'openmpi'

- 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
sudo apt-get install -y libfftw3-dev libhdf5-dev python3-numpy python3-dev libtiff5-dev unzip libsqlite3-dev default-jdk git cmake libopencv-dev make cmake
sudo apt-get install -y libfftw3-dev libopenmpi-dev libhdf5-dev libtiff5-dev libsqlite3-dev default-jdk git cmake openmpi-bin ${{ matrix.compiler.cc }} ${{ matrix.compiler.cxx }}

- name: Install CUDA
uses: Jimver/cuda-toolkit@master
uses: Jimver/cuda-toolkit@v0.2.23
id: cuda-toolkit
with:
cuda: '11.8.0'
cuda: '12.6.0'
method: network
sub-packages: '["nvcc", "toolkit"]'

- 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
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
auto-activate-base: true
activate-environment: scipion3
python-version: "3.8"

- name: Install Scipion
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

pip install --user scipion-installer
python3 -m scipioninstaller -conda -noAsk scipion
scipion/scipion3 run conda install -c conda-forge libstdcxx-ng

- 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
# Checkout Xmipp to Pull Request branch if exists
- name: Conditionally checkout Xmipp to ${{ github.head_ref }}
working-directory: ${{ github.workspace }}/../xmipp
env:
Expand All @@ -64,49 +64,39 @@ jobs:
git checkout $BRANCH_NAME
fi

# Installing Xmipp
# Log is shown afterwards because new Xmipp's installer does not show error trace if there is any
- name: Compile Xmipp and show log
- name: Compile Xmipp
working-directory: ${{ github.workspace }}/../xmipp
env:
BUILD_TESTS: True
run: |
../scipion/scipion3 run ./xmipp
#TODO: Remove last "cat compileLOG.txt" once there is a new Scipion release
../scipion/scipion3 run ./xmipp --keep-output || (cat compileLOG.txt && false)

# Checkout scipion-em-xmipp to Pull Request branch if exists, else to devel
# Checkout scipion-em-xmipp to Pull Request branch if exists
- name: Conditionally checkout scipion-em-xmipp to ${{ github.head_ref }}
working-directory: ${{ github.workspace }}/../xmipp/src/scipion-em-xmipp
env:
BRANCH_NAME: ${{ github.head_ref }}
run: |
if [ $(git ls-remote --heads https://github.com/I2PC/scipion-em-xmipp.git $BRANCH_NAME | wc -l) -eq 1 ]; then
git checkout $BRANCH_NAME
else
git checkout devel
fi

# Install scipion-em-xmipp, because scipion-em-xmipptomo depends on it
- name: Install scipion-em-xmipp
working-directory: ${{ github.workspace }}/../xmipp/src/scipion-em-xmipp
run: ${{ github.workspace }}/../scipion/scipion3 installp -p . --devel --noBin

# Check out the repository in the pull request
- name: Checkout repository
uses: actions/checkout@main
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Install plugin from pull request
working-directory: ${{ github.workspace }}
run: ../scipion/scipion3 installp -p . --devel

# Currently, test script is being downloaded from scipion-chem, but that should be temporary
# Ideally, the script might be included in scipion core to be able to import it,
# or maybe host it in a separate repository common with useful scripts for all scipion plugins
- name: Run tests
working-directory: ${{ github.workspace }}/${{ vars.FOLDER_WITH_VERSION }}
run: |
wget https://raw.githubusercontent.com/scipion-chem/scipion-chem/devel/pwchem/runTests.py
eval "$(${{ github.workspace }}/../miniconda/bin/conda shell.bash hook)"
python runTests.py ${{ github.workspace }}/../scipion/scipion3 ${{ vars.FOLDER_WITH_VERSION }} -noGPU -testData=testData.json -j=3
pip install --user scipion-testrunner
scipion_testrunner ${{ github.workspace }}/../scipion/scipion3 ${{ vars.FOLDER_WITH_VERSION }} --noGpu --testData=testData.json -j=3
21 changes: 11 additions & 10 deletions .github/workflows/main.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
# Workflow to send master to pypi and tag the branch:
# You need to edit FOLDER_WITH_VERSION with the folder that has the __version__ value.

name: master to pypi with comments and tag


# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]

env:
FOLDER_WITH_VERSION: xmipptomo
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@main

- name: Set up MPI
uses: mpi4py/setup-mpi@v1
uses: mpi4py/setup-mpi@master
with:
mpi: 'openmpi'

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@main
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install scipion-pyworkflow
pip install scipion-em
pip install scipion-em-xmipp==20.7rc1

- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/* -c "${{ secrets.PYPI_COMMENT }}"

- name: Get version and tag
run: |
export PACKAGE_VERSION=$(python -c "import $FOLDER_WITH_VERSION; print('VERSION', 'v'+$FOLDER_WITH_VERSION.__version__)" | grep VERSION | sed "s/VERSION //g")
Expand Down
2 changes: 1 addition & 1 deletion xmipptomo/testData.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"others": [
{
"test": "test_protocol_deep_misalignment_detection.TestDeepMisaligmentDetection",
"reason": "Needs DLTK to work, which cannot be installed in GitHub actions due to lack of GPU access."
"reason": "Needs DLTK to work, which cannot be installed in GitHub actions due to lack of GPU access"
},
{
"test": "test_protocol_subtraction_subtomo.TestXmipptomoSubtractionSubtomo",
Expand Down
Loading