forked from WISDEM/WISDEM
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (121 loc) · 4.43 KB
/
CI_WISDEM.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_WISDEM
# We run CI on push commits and pull requests 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_conda:
name: Conda Build-Test (${{ 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, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: checkout repository
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
# Install dependencies of WEIS specific to ubuntu
- name: Add dependencies ubuntu specific
if: false == contains( matrix.os, 'windows')
run: |
conda install -y petsc4py gfortran
# Install dependencies of WISDEM specific to windows
- name: Add dependencies windows specific
if: contains( matrix.os, 'windows')
run: |
conda install -y m2w64-toolchain libpython
- name: Debug config
run: |
conda list
which -a gfortran
which pip
- name: Install WISDEM with setup
run: |
pip install --no-build-isolation --no-deps -e . -v
# Debugging session
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Run all tests
if: contains( matrix.os, 'ubuntu')
run: |
pytest -p no:warnings --disable-warnings --cov=wisdem
- name: Limited test for non Linux
if: false == contains( matrix.os, 'ubuntu')
run: |
cd wisdem/test/test_gluecode
pytest -p no:warnings --disable-warnings test_g*
# 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
build_pip:
name: Pip Build-Test (${{ matrix.os }} Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: False
matrix:
os: [ubuntu-latest, windows-latest, macos-13] #mac-13 intel, mac-latest is arm
python-version: ["3.11"]
steps:
- name: Setup GNU Fortran
if: false == contains( matrix.os, 'windows')
uses: awvwgk/setup-fortran@v1
- name: Install compiler
if: false == contains( matrix.os, 'windows')
id: install_cc
uses: rlalik/setup-cpp-compiler@master
with:
compiler: clang
- name: Install mingw-w64 on Windows
if: contains( matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
path-type: inherit
install: |
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gcc-fortran
- name: checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
id: cp
with:
python-version: ${{ matrix.python-version }}
update-environment: true
- name: Set compilers
if: false == contains( matrix.os, 'windows')
run: |
echo "CC=${{ steps.install_cc.outputs.cc }}" >> $GITHUB_ENV
echo "CXX=${{ steps.install_cc.outputs.cxx }}" >> $GITHUB_ENV
- name: Install WISDEM with setup
env:
MESON_ARGS: "-Dpython_target=${{ steps.cp.outputs.python-path }}"
run: |
'${{ steps.cp.outputs.python-path }}' -m pip install --upgrade pip install pytest numpy
'${{ steps.cp.outputs.python-path }}' -m pip install -v .
- name: Limited test
run: |
cd wisdem/test/test_gluecode
pytest -p no:warnings --disable-warnings test_g*