forked from NREL/hercules
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.69 KB
/
check-working-examples.yaml
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
name: Check Examples APIs
on: [push, pull_request]
jobs:
examples-check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest] #, macos-latest, windows-latest]
fail-fast: False
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[develop]"
pip install git+https://github.com/NREL/electrolyzer.git
pip install https://github.com/NREL/SEAS/blob/main/SEAS.tar.gz?raw=true
pip install git+https://github.com/NREL/floris.git@v4
- name: Run example 06_amr_wind_standin_and_battery
# Run all examples and test that they finish successfully. Do not evaluate the results.
# Copy the examples to a new directory outside of the repo to ensure that there is no
# reliance on the repo directory structure.
run: |
#mkdir -p temp1/temp2/temp3
#cp -rv example_case_folders/06_amr_wind_standin_and_battery/ temp1/temp2/temp3/.
# cd temp1/temp2/temp3/06_amr_wind_standin_and_battery/
cd example_case_folders/06_amr_wind_standin_and_battery/
error_found=0 # 0 is false
error_results="Error in example:"
# Try running the bash script
if ! bash batch_script.sh; then
error_results="${error_results}"$'\n'" - run_example.sh"
error_found=1
fi
if [[ ! $error_found ]]; then
echo "${error_results}"
fi
exit $error_found