-
Notifications
You must be signed in to change notification settings - Fork 2
126 lines (97 loc) · 3.13 KB
/
ci.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
# This file is based on examples in
# https://docs.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions
# Note that all the "sudo" commands here appear to cause a warning message
# "sudo: setrlimit(RLIMIT_CORE): operation not permitted"
# This appears to be a known harmless annoyance:
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/11122
name: CI
on: [push, pull_request]
jobs:
CI:
strategy:
fail-fast: false
matrix:
precision: ['single', 'double']
os: [ubuntu-latest, macos-latest]
exclude:
# macos with single has strange errors on github actions, even though it works on my laptop
- precision: 'single'
os: macos-latest
runs-on: ${{ matrix.os }}
name: ${{ matrix.os}}, ${{ matrix.precision }} precision
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
steps:
# First print out lots of information. We do this in separate
# "name" blocks because otherwise the output gets mixed together
# in the github actions log.
- name: Print user and group id
run: |
set -ex
id
- name: PWD
run: |
set -ex
pwd
- name: ls -l
run: |
set -ex
ls -l
- name: apt-get any needed packages
if: "contains(matrix.os, 'ubuntu')"
run: |
sudo apt-get update
sudo apt-get install -y build-essential openmpi-bin libopenmpi-dev liblapack-dev git cmake libnetcdf-dev libgsl-dev
# If at some point we need the C++ wrapper for netcdf, it is libnetcdf-c++4-dev
- name: Get any needed packages from homebrew
if: "contains(matrix.os, 'macos')"
run: |
brew install netcdf
brew install open-mpi
brew install gsl
- name: Print versions
run: |
which mpicc
which mpiexec
cmake --version
- uses: actions/checkout@v3
# If we want submodules downloaded, uncomment the next 2 lines:
#with:
# submodules: true
- name: Print CMake version
run: cmake --version
- name: which python3 after python setup
run: which python3
- name: which pip after python setup
run: pip --version
- name: which pip using sudo
run: sudo pip --version
- name: which pip using sudo -E
run: sudo -E pip --version
- name: which python using sudo
run: sudo which python3
- name: which python using sudo -E
run: sudo -E which python3
- name: env after adding python
run: env
- name: CMake configure, double precision
run: cmake .
if: matrix.precision == 'double'
- name: CMake configure, single precision
run: cmake -DSINGLE=1 .
if: matrix.precision == 'single'
- name: Compile
run: make
- name: Run unit tests
run: make test
- name: Run examples, double precision
run: |
cd examples
./run_examples
if: matrix.precision == 'double'
- name: Run examples, single precision
run: |
cd examples
./run_examples_single
if: matrix.precision == 'single'