forked from WISDEM/WEIS
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (82 loc) · 3.33 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
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-latest"]
python-version: ["3.9","3.10","3.11"]
steps:
#- name: Setup GNU Fortran
# # if: false == contains( matrix.os, 'windows')
# uses: awvwgk/setup-fortran@main
- 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 WISDEM specific to mac # libgcc openblas libopenblas
- name: Add dependencies mac specific
if: contains( matrix.os, 'mac')
run: |
conda install -y petsc4py mpi4py openmpi compilers
# 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: contains( matrix.os, 'ubuntu')
# (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
which -a gfortran
printenv | sort
# Debugging session
#- name: Setup tmate session
# if: contains( matrix.os, 'mac')
# uses: mxschmitt/action-tmate@v3
# Install WEIS
- name: Install WEIS
run: |
python setup.py develop
# 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.10')
uses: coverallsapp/github-action@v2
# This also works, https://github.com/AndreMiras/coveralls-python-action
#uses: AndreMiras/coveralls-python-action@develop
#env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#run: |
# coveralls --service=github