-
Notifications
You must be signed in to change notification settings - Fork 39
128 lines (109 loc) · 3.17 KB
/
cpymad.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
# This workflow builds and tests cpymad against MAD-X to check if there are
# any major breaking changes that should be conveyed to the cpymad developers.
name: cpymad
on:
push:
pull_request:
jobs:
madx-linux:
runs-on: ubuntu-latest
env:
MADXDIR: ${{ github.workspace }}/dist
steps:
- uses: actions/checkout@v3
- name: Install build dependencies
run: |
sudo apt-get install -qy \
libblas-dev \
liblapack-dev \
gfortran
- name: Configure
run: |
cmake . \
-DMADX_X11=OFF \
-DMADX_STATIC=ON \
-DMADX_ONLINE=OFF \
-DMADX_FORCE_32=OFF \
-DMADX_INSTALL_DOC=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=$MADXDIR \
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build . --target install
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: madx-static-ubuntu-64
path: ${{ env.MADXDIR }}
madx-macos:
runs-on: macos-latest
env:
MADXDIR: ${{ github.workspace }}/dist
steps:
- uses: actions/checkout@v3
- name: Configure
run: |
cmake . \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_C_COMPILER=gcc-12 \
-DCMAKE_CXX_COMPILER=g++-12 \
-DCMAKE_Fortran_COMPILER=gfortran-12 \
-DBUILD_SHARED_LIBS=OFF \
-DMADX_STATIC=OFF \
-DCMAKE_INSTALL_PREFIX=$MADXDIR \
-DCMAKE_BUILD_TYPE=Release \
-DMADX_INSTALL_DOC=OFF \
-DMADX_ONLINE=OFF \
-DMADX_FORCE_32=OFF \
-DMADX_X11=OFF
- name: Build
run: cmake --build . --target install
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: madx-static-macos-64
path: ${{ env.MADXDIR }}
cpymad:
runs-on: ${{ matrix.os }}-latest
needs: [madx-linux, madx-macos]
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
version: [master, v1.9.3]
env:
MADXDIR: madx
steps:
- name: Checkout cpymad
uses: actions/checkout@v3
with:
repository: hibtc/cpymad
ref: ${{ matrix.version }}
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Download MAD-X
uses: actions/download-artifact@v2
with:
name: madx-static-${{ matrix.os }}-64
path: ${{ env.MADXDIR }}
- name: Install python setup dependencies
run: |
pip install cython
pip install pytest
pip install setuptools
- name: Build cpymad
run: |
if [[ ${{ matrix.os }} == macos ]]; then
export CC=gcc-12
fi
export X11=0 BLAS=1 LAPACK=1
python setup.py build_ext -lm
pip install -e .
- name: Run tests
run: |
set -ex
python test/test_madx.py
python test/test_util.py
env:
GFORTRAN_UNBUFFERED_PRECONNECTED: y