DLC Generation - Refactor and New Cases #2173
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@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 | |
#- 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 | |
- 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 | |
# Run all tests within WEIS, but not computationally expensive examples | |
- name: Run tests within WEIS | |
run: | | |
pytest --cov-config=.coverageac --cov=weis -p no:warnings --disable-warnings weis | |
# Run coveralls | |
- name: Run coveralls | |
if: contains( matrix.os, 'ubuntu') && contains( matrix.python-version, '3.11') | |
#uses: coverallsapp/github-action@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
coveralls --service=github |