-
Notifications
You must be signed in to change notification settings - Fork 62
158 lines (137 loc) · 4.82 KB
/
test_with_MFEM_release.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
147
148
149
150
151
152
153
154
155
156
157
158
name: Test_with_MFEM_release
on:
pull_request:
types:
- labeled
#push:
# branches: [ test ]
#pull_request:
# branches: [ test ]
# types: [synchronize]
jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'in-test-with-mfem-release')
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9"]
#python-version: ["3.10"]
#os: [ubuntu-latest]
os: [ubuntu-20.04]
# USE_FLAGS : cuda, parallel, libceed
env:
- { USE_FLAGS: "000"}
- { USE_FLAGS: "010"}
include:
- os: macos-latest
python-version: 3.9
env: {USE_FLAGS: "000"}
runs-on: ${{ matrix.os }}
#env: ${{ matrix.env }}
env:
USE_FLAGS: ${{ matrix.env.USE_FLAGS }}
CUDA: "11.5"
SANDBOX: ~/sandbox
steps:
- uses: actions/checkout@v3
# with:
# ref: master_tracking_branch
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
#python -m pip install --upgrade pip setuptools wheel
python -c "import setuptools;print(setuptools.__version__)"
PYTHONLIB=~/sandbox/lib/python${{ matrix.python-version }}/site-packages
mkdir -p $PYTHONLIB
export PYTHONPATH=$PYTHONLIB:$PYTHONPATH
echo "PYTHONPATH:"$PYTHONPATH
pip install six --verbose
if [ "${{matrix.python-version}}" = "3.10" ] ; then
pip install numba numba-scipy --verbose
#pip install scipy
else
pip install numba numba-scipy --verbose
fi
if [ -f requirements.txt ]; then
pip install -r requirements.txt --prefix=~/sandbox --verbose
fi
python -c "import sys;print(sys.path)"
python -c "import numpy;print(numpy.__file__)"
which swig # this default is 4.0.1
pip install swig --prefix=~/sandbox
export PATH=/usr/local/cuda-${CUDA}/bin:~/sandbox/bin:$PATH
which swig
swig -version
if [ "${USE_FLAGS:0:1}" = "1" ] ; then
echo $cuda
source ./ci_scripts/add_cuda_11_5.sh;
fi
if [ "${USE_FLAGS:1:1}" = "1" ] ; then
sudo apt-get install mpich;
sudo apt-get install libmpich-dev;
pip install mpi4py --prefix=~/sandbox
#pip install mpi4py --no-cache-dir --prefix=~/sandbox;
#python -m pip install git+https://github.com/mpi4py/mpi4py
python -c "import mpi4py;print(mpi4py.get_include())";
fi
ls -l $PYTHONLIB
- name: Build
run: |
export PATH=/usr/local/cuda-${CUDA}/bin:~/sandbox/bin:$PATH
PYTHONLIB=~/sandbox/lib/python${{ matrix.python-version }}/site-packages
export PYTHONPATH=$PYTHONLIB:$PYTHONPATH
echo $PATH
echo $PYTHONPATH
echo $SANDBOX
echo "SWIG exe"$(which swig)
if [ "${USE_FLAGS}" = "000" ]; then
# test workflow to manually run swig
python setup.py clean --swig
python setup.py install --ext-only --with-gslib --verbose
python setup.py install --swig --with-gslib --verbose
python setup.py install --skip-ext --skip-swig --with-gslib --verbose
fi
if [ "${USE_FLAGS}" = "010" ]; then
python setup.py install --with-gslib --with-parallel --prefix=$SANDBOX
fi
- name: RUN_EXAMPLES
run: |
export PATH=/usr/local/cuda-${CUDA}/bin:$PATH
PYTHONLIB=~/sandbox/lib/python${{ matrix.python-version }}/site-packages
export PYTHONPATH=$PYTHONLIB:$PYTHONPATH
echo $PATH
echo $PYTHONPATH
echo $SANDBOX
cd test
echo $PATH
echo $PYTHONPATH
if [ "${USE_FLAGS}" = "000" ]; then
python run_examples.py -serial -verbose
fi
if [ "${USE_FLAGS}" = "010" ]; then
which mpicc
python run_examples.py -parallel -verbose -np 2
fi
- name: Generate Artifact
if: always()
run: |
tar -cvzf sandbox.tar.gz test/sandbox
- name: Generate artifact name
if: always()
id: generate-name
run: |
txt=$(python -c "import datetime;print(datetime.datetime.now().strftime('%H_%M_%S_%f'))")
name="test_result_"${txt}"_"${{ github.run_id }}".tar.gz"
echo $name
# (deprecated) echo "::set-output name=artifact::${name}"
echo "artifact=${name}" >> $GITHUB_OUTPUT
- name: Upload Artifact
uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ steps.generate-name.outputs.artifact }}
path: sandbox.tar.gz
retention-days: 1