-
Notifications
You must be signed in to change notification settings - Fork 41
146 lines (126 loc) · 4.87 KB
/
CI_WEIS.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI_WEIS
# We run CI on push commits on all branches
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build (${{ matrix.os }} Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macOS-13", "macOS-latest", "windows-latest"] # mac13 is intel, mac-14 arm
python-version: ["3.9","3.10","3.11","3.12"]
steps:
- uses: actions/checkout@v4
- name: Install conda/mamba
uses: conda-incubator/setup-miniconda@v3
# https://github.com/marketplace/actions/setup-miniconda
with:
# To use mamba, uncomment here, comment out the miniforge line
# mamba-version: "*"
miniforge-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
activate-environment: test
auto-activate-base: false
#- name: Add dependencies windows specific
# if: contains( matrix.os, 'windows')
# run: |
# conda install -y -c intel intel-openmp mkl
- name: Add dependencies ubuntu specific
if: false == contains( matrix.os, 'windows')
run: |
conda install -y petsc4py mpi4py openmpi pyoptsparse
- name: Add test packages
run: |
conda install -y pytest pytest-cov coveralls treon gdown
- name: Show custom environment
run: |
conda list
printenv | sort
# Install WEIS
- name: Install WEIS
run: |
python -m pip install --no-deps -e . -v
# Debugging session
#- name: Setup tmate session
# if: contains( matrix.os, 'windows')
# uses: mxschmitt/action-tmate@v3
#- name: Show openfast environment
# run: |
# which -a openfast
# cd /c/Miniconda3/envs/test/Library/bin/
# ls *fast*.exe
# ls *fast*.dll
# openfast -h
# python -c "import ctypes; ctypes.cdll.LoadLibrary('openfastlib.dll')"
# ls *fast*.dll
# cd examples/03_NREL5MW_OC3_spar
# python weis_driver.py
# List the collected tests for debugging purposes
#- name: List tests
# run: |
# pytest --collect-only weis
# Test walkthrough notebook
- name: Test postprocessing notebooks
if: contains( matrix.os, 'ubuntu') && contains( github.event_name, 'pull_request')
env:
RUN_EXHAUSTIVE: 1
run: |
cd examples/16_postprocessing
gdown --no-check-certificate 1AtLjjX5xpPqlHkfwDqeUj6VBMOYWcjmV
unzip outputs
treon plot_FAST.ipynb
treon rev_DLCs_WEIS.ipynb
treon rev_Opt.ipynb
treon rev_WEIS_CSV.ipynb
# Run all tests within WEIS, but not computationally expensive examples
- name: Run tests within WEIS
if: false == contains( matrix.os, 'ubuntu') || contains( github.event_name, 'push')
run: |
pytest -p no:warnings --disable-warnings --cov=weis weis
# Run long tests in on pull request
- name: Run exhaustive
if: contains( matrix.os, 'ubuntu') && contains( github.event_name, 'pull_request')
env:
RUN_EXHAUSTIVE: 1
run: |
pytest -p no:warnings --disable-warnings weis
# Run parallel script calling OpenFAST
- name: Run parallel cases
if: contains( matrix.os, 'ubuntu') && contains( github.event_name, 'pull_request')
env:
RUN_EXHAUSTIVE: 1
run: |
cd examples/02_run_openfast_cases
mpiexec -np 2 python weis_driver_loads.py
cd ../03_NREL5MW_OC3_spar
mpiexec -np 2 python weis_driver.py
cd ../05_IEA-3.4-130-RWT
mpiexec -np 2 python weis_driver.py
cd ../09_design_of_experiments
mpiexec -n 2 python DOE_raft.py
mpiexec -n 2 --bind-to core python DOE_openfast.py
python postprocess_results.py
cd ../17_IEA22_Optimization
mpiexec -n 2 python driver_weis_raft_opt.py
# Run scripts within dac folder
# - name: Run examples distributed aerodynamic control
# run: |
# cd examples/dac_flaps
# python dac_driver.py
# Run coveralls
- name: Run coveralls
if: contains( matrix.os, 'ubuntu') && contains( matrix.python-version, '3.11')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#uses: coverallsapp/github-action@v2
#with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github