Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding testing as github action #10

Merged
merged 10 commits into from
May 9, 2024
21 changes: 21 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Github FORCE run tests
run-name: ${{ github.actor }} is testing out FORCE
on: [push, pull_request]
jobs:
Runtests-FORCE-Linux:
runs-on: [self-hosted, linux]
steps:
- run: echo " The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo " This job is now running on a ${{ runner.os }} server"
- run: echo " The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: pwd
- run: WD=`(cd ../../.. && pwd)` && export RAVEN_LIBS_NAME="raven_libs_"`basename $WD` && ./initalize_tests.sh
- run: source raven/scripts/establish_conda_env.sh --load && ./run_tests
- name: Archive
uses: actions/upload-artifact@v4
if: always()
with:
name: tests_results
path: tests
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "raven"]
path = raven
url = https://github.com/idaholab/raven.git
[submodule "HERON"]
path = HERON
url = https://github.com/idaholab/HERON.git
1 change: 1 addition & 0 deletions HERON
Submodule HERON added at 290e83
18 changes: 18 additions & 0 deletions initalize_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

git submodule init raven
git submodule init HERON
git submodule update

cd raven

git submodule init plugins/TEAL/
git submodule update

python scripts/install_plugins.py -s plugins/TEAL
python scripts/install_plugins.py -s ../HERON/

./scripts/establish_conda_env.sh --install
./build_raven

(source ./scripts/establish_conda_env.sh --load && conda install -y -c conda-forge openpyxl)
1 change: 1 addition & 0 deletions raven
Submodule raven added at b56970
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.insert(1, os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.insert(1, os.path.dirname(__file__).rsplit("FORCE",maxsplit=1)[:-1][0]+"FORCE/src")
import convert_utils as xm
from hysys import extract_all_hysys_components
from apea import extract_all_apea_components
Expand Down Expand Up @@ -75,4 +75,4 @@
print((xm.prettify(new_HERON_tree )), file=out)

print (f" \n The new HERON file is updated/created at: '{output_file}' ")
print("\n",'\033[95m',"Step4 (Component Sets are loaded to the HERON input XMl file) is complete", '\033[0m', "\n")
print("\n",'\033[95m',"Step4 (Component Sets are loaded to the HERON input XMl file) is complete", '\033[0m', "\n")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.append(os.path.dirname(__file__).split("FORCE")[:-1][0]+"/FORCE/src")
sys.path.append(os.path.dirname(__file__).rsplit("FORCE",maxsplit=1)[:-1][0]+"/FORCE/src")
from heron import create_componentsets_in_HERON
import convert_utils as xm

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import sys
import os
import argparse
sys.path.append(os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.append(os.path.dirname(__file__).rsplit("FORCE",maxsplit=1)[:-1][0]+"FORCE/src")
from apea import extract_all_apea_components

# # Specifying terminal command arguments
Expand All @@ -25,4 +25,4 @@
parser.add_argument("apea_xlsx_outputs_folder_path", help="apea_xlsx_outputs_folder_path")
args = parser.parse_args()

extract_all_apea_components(args.apea_xlsx_outputs_folder_path)
extract_all_apea_components(args.apea_xlsx_outputs_folder_path)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.insert(1, os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.insert(1, os.path.dirname(__file__).rsplit("FORCE",maxsplit=2)[:-1][0]+"FORCE/src")
from hysys import extract_all_hysys_components
from apea import extract_all_apea_components
from force import create_all_force_components_from_hysys_apea, extract_all_force_componentsets
Expand Down Expand Up @@ -52,4 +52,4 @@

print("\n",'\033[95m', "Step3 (creating FORCE components Sets) begins", '\033[0m', "\n")
extract_all_force_componentsets(args.componentSets_folder, FORCE_comps_list)
print("\n",'\033[95m', "Step3 (creating FORCE componentsSets) is complete", '\033[0m', "\n")
print("\n",'\033[95m', "Step3 (creating FORCE componentsSets) is complete", '\033[0m', "\n")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.insert(1, os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.insert(1, os.path.dirname(__file__).rsplit("FORCE",maxsplit=2)[:-1][0]+"FORCE/src")
from hysys import extract_all_hysys_components
from apea import extract_all_apea_components
from force import create_all_force_components_from_hysys_apea
Expand All @@ -42,4 +42,4 @@

print("\n",'\033[95m', "Step2 (creating HYSES and APEA FORCE components) begins", '\033[0m', "\n")
FORCE_comps_list = create_all_force_components_from_hysys_apea( [hysys_comps_list, apea_comps_list ], args.hyses_xlsx_outputs_folder_path)[0]
print("\n",'\033[95m', "Step2 (creating HYSES and APEA FORCE components) is complete", '\033[0m', "\n")
print("\n",'\033[95m', "Step2 (creating HYSES and APEA FORCE components) is complete", '\033[0m', "\n")
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.append(os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.append(os.path.dirname(__file__).rsplit("FORCE",maxsplit=1)[:-1][0]+"FORCE/src")
from hysys import extract_all_hysys_components


Expand All @@ -28,4 +28,4 @@
parser.add_argument("hyses_xlsx_outputs_folder_path", help="hyses_xlsx_outputs_folder_path")
args = parser.parse_args()

extract_all_hysys_components(args.hyses_xlsx_outputs_folder_path)
extract_all_hysys_components(args.hyses_xlsx_outputs_folder_path)
Loading