Skip to content

Commit

Permalink
Merge pull request #13 from scipion-chem/ms_actions
Browse files Browse the repository at this point in the history
Actions
  • Loading branch information
DaniDelHoyo committed Aug 18, 2023
2 parents 025824a + cd1ff34 commit f8dd734
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Name of the GitHub Action
name: Build plugin 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-latest

# Define the steps to be taken in the job
steps:
# Installing scipion and miniconda dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget gcc g++ libopenmpi-dev make
# 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 miniconda/
source miniconda/etc/profile.d/conda.sh
conda update -n base -c defaults conda -y
# Installing Scipion
- name: Install Scipion
working-directory: ${{ github.workspace }}/../
run: |
eval "$(miniconda/bin/conda shell.bash hook)"
pip3 install --user scipion-installer
python3 -m scipioninstaller -conda -noXmipp -noAsk scipion
# Installing scipion-chem
# Checkout to Pull Request branch if exists, by default stays in devel
- name: Install scipion-chem (in branch ${{ github.head_ref }} if exists)
working-directory: ${{ github.workspace }}/../
env:
REPO_NAME: scipion-chem
BRANCH_NAME: ${{ github.head_ref }}
run: |
git clone https://github.com/scipion-chem/$REPO_NAME.git
if [ $(git ls-remote --heads https://github.com/scipion-chem/$REPO_NAME.git $BRANCH_NAME | wc -l) -eq 1 ]; then
cd $REPO_NAME && git checkout $BRANCH_NAME
fi
scipion/scipion3 installp -p $REPO_NAME --devel
# Installing scipion-chem-autodock
# Checkout to Pull Request branch if exists, by default stays in devel
- name: Install scipion-chem-autodock (in branch ${{ github.head_ref }} if exists)
working-directory: ${{ github.workspace }}/../
env:
REPO_NAME: scipion-chem-autodock
BRANCH_NAME: ${{ github.head_ref }}
run: |
git clone https://github.com/scipion-chem/$REPO_NAME.git
if [ $(git ls-remote --heads https://github.com/scipion-chem/$REPO_NAME.git $BRANCH_NAME | wc -l) -eq 1 ]; then
cd $REPO_NAME && git checkout $BRANCH_NAME
fi
scipion/scipion3 installp -p $REPO_NAME --devel
# 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
20 changes: 20 additions & 0 deletions rosetta/runTests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# General imports
import subprocess, sys

def runTests():
"""
This function runs the runTests.py script inside package pwchem.
Note: To run this script, the scipion3 env must be active.
"""
# Define the command to run the script
command = ["python", "-m", "pwchem.runTests"] + sys.argv[1:]

# Run the script as a separate process
try:
subprocess.run(command, check=True)
except subprocess.CalledProcessError:
sys.exit(1)

# Call to main execution
if __name__ == "__main__":
runTests()
14 changes: 14 additions & 0 deletions rosetta/testData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"datasets": ["model_building_tutorial", "smallMolecules"],
"skippable": {
"gpu": [

],
"dependencies": [

],
"others": [

]
}
}

0 comments on commit f8dd734

Please sign in to comment.