-
Notifications
You must be signed in to change notification settings - Fork 41
161 lines (140 loc) · 5.58 KB
/
run_exhaustive_examples.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: run_exhaustive_examples
on: [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 }}
# if: "contains(github.event.head_commit.message, 'exhaustive_CI')" # This line could be used to have commit-specific instructions
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"] #, "macOS-latest"]
python-version: ["3.9","3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Install conda/mamba
uses: conda-incubator/setup-miniconda@v2
# 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
miniforge-variant: Mambaforge
channels: conda-forge
extra-specs: |
python=${{ matrix.python-version }}
mpi4py
petsc4py
openmpi
sel(osx): compilers
sel(win): m2w64-toolchain
sel(win): libpython`
# # Even miniconda gets bogged down- try mamba
# - name: Install Conda environment with Micromamba
# uses: mamba-org/provision-with-micromamba@main
# with:
# environment-file: environment.yml
# environment-name: test
# channels: conda-forge
# extra-specs: |
# python=${{ matrix.python-version }}
# mpi4py
# petsc4py
# openmpi
# sel(osx): compilers
# sel(win): m2w64-toolchain
# sel(win): libpython`
# This is the more official way to do miniconda, but it messes with the GitHub worker environment and shell quite a bit
#- uses: conda-incubator/setup-miniconda@v2
# # https://github.com/marketplace/actions/setup-miniconda
# with:
# miniconda-version: "latest"
# channels: conda-forge
# auto-update-conda: true
# python-version: ${{ matrix.python-version }}
# environment-file: environment.yml
# activate-environment: test
# auto-activate-base: false
# This is a less official, but more lightweight way to do miniconda
#- uses: s-weigand/setup-conda@v1
# # https://github.com/marketplace/actions/setup-conda
# with:
# update-conda: true
# python-version: ${{ matrix.python-version }}
# conda-channels: conda-forge
# activate-conda: true
#- run: conda env update --file environment.yml
#- name: Show custom environment
# shell: bash
# run: |
# cat $GITHUB_ENV
# printenv
# Install dependencies of WISDEM specific to windows
#- name: Add dependencies mac specific
# if: contains( matrix.os, 'mac')
# run: |
# conda install -y compilers
# gfortran --version
# Install dependencies of WISDEM specific to windows
#- name: Add dependencies windows specific
# if: contains( matrix.os, 'windows')
# run: |
# conda install -y m2w64-toolchain libpython
# Install dependencies of WEIS specific to ubuntu
#- name: Add dependencies ubuntu specific
# if: false == contains( matrix.os, 'windows')
# # (if you use the shell here, cannot use 'compiler' package otherwise get link problems to system libraries
# # Mpi only seems to work with the shell command though, so instead rely on system compilers
# run: |
# conda install -y petsc4py mpi4py openmpi
# python -c "import platform; print(platform.node())"
- name: Show custom environment
run: |
conda list
# Debugging session
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# Install WEIS
- name: Install WEIS
run: |
python setup.py develop
# Test walkthrough notebook
- name: Test postprocessing notebooks
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 examples
- name: Run tests within WEIS
run: |
cd weis/test
python run_examples.py
# Run scripts within rotor_opt folder with MPI
- name: Run parallel examples rotor optimization
run: |
cd examples/05_IEA-3.4-130-RWT
mpirun -np 2 python weis_driver.py
# Run scripts within dac folder
# - name: Run examples distributed aerodynamic control
# run: |
# cd examples/dac_flaps
# python dac_driver.py
# Run scripts within design of experiments folder
- name: Run examples design of experiments
run: |
cd examples/09_design_of_experiments
mpirun -n 2 --bind-to core python DOE_openfast.py
python postprocess_results.py