From f9263ba210765e6ff61892dbb24d3e5a1197527d Mon Sep 17 00:00:00 2001 From: Martin Salinas Date: Sat, 31 Aug 2024 17:52:15 +0200 Subject: [PATCH] Fixed test action --- .../{buildPlugin.yml => build-and-test.yml} | 50 +++++++------------ 1 file changed, 19 insertions(+), 31 deletions(-) rename .github/workflows/{buildPlugin.yml => build-and-test.yml} (57%) diff --git a/.github/workflows/buildPlugin.yml b/.github/workflows/build-and-test.yml similarity index 57% rename from .github/workflows/buildPlugin.yml rename to .github/workflows/build-and-test.yml index 052d5c0..c73a068 100644 --- a/.github/workflows/buildPlugin.yml +++ b/.github/workflows/build-and-test.yml @@ -1,30 +1,29 @@ -# Name of the GitHub Action name: Build scipion-em-xmipptomo 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 - # 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@master + 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 - name: Install CUDA uses: Jimver/cuda-toolkit@master @@ -35,26 +34,23 @@ jobs: 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@main + 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 + pip 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 + - name: Install Scons in Scipion's enviroment run: | - eval "$(${{ github.workspace }}/../miniconda/bin/conda shell.bash hook)" - conda activate scipion3 - pip install scons + pip install --user scons - name: Cloning Xmipp working-directory: ${{ github.workspace }}/../ @@ -70,16 +66,13 @@ 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 || (cat compileLOG.txt && false) - cat compileLOG.txt - #TODO: Remove last "cat compileLOG.txt" once there is a new Scipion release # Checkout scipion-em-xmipp to Pull Request branch if exists, else to devel - name: Conditionally checkout scipion-em-xmipp to ${{ github.head_ref }} @@ -93,7 +86,6 @@ jobs: 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 @@ -108,12 +100,8 @@ jobs: 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