-
Notifications
You must be signed in to change notification settings - Fork 43
189 lines (156 loc) · 6.95 KB
/
nouse_install.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: nouse_install
on:
push:
pull_request:
schedule:
- cron: '34 17 * * *'
jobs:
nouse_install_ubuntu:
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && vars.MMGH_NIGHTLY == 'enable') }}
name: nouse_install_${{ matrix.os }}_Release
runs-on: ${{ matrix.os }}
env:
JOB_CMAKE_ARGS: -DBUILD_QT=OFF -DUSE_CLANG_TIDY=OFF -DCMAKE_BUILD_TYPE=Release
strategy:
matrix:
os: [ubuntu-22.04]
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: event name
run: |
echo "github.event_name: ${{ github.event_name }}"
- name: dependency by apt
run: |
sudo apt-get -qqy update
sudo apt-get -qy install \
sudo curl git build-essential make cmake libc6-dev gcc g++ \
python3 python3-dev python3-venv
- name: dependency by pip
run: |
sudo pip3 install setuptools
sudo pip3 install numpy pytest jsonschema flake8
- name: dependency by manual script
run: sudo ${GITHUB_WORKSPACE}/contrib/dependency/install.sh pybind11
- name: show dependency
# Copy the commands from contrib/dependency/showdep.sh
run: |
echo "gcc path: $(which gcc)"
echo "gcc version: $(gcc --version)"
echo "cmake path: $(which cmake)"
echo "cmake version: $(cmake --version)"
echo "python3 path: $(which python3)"
echo "python3 version: $(python3 --version)"
echo "python3-config --prefix: $(python3-config --prefix)"
echo "python3-config --exec-prefix: $(python3-config --exec-prefix)"
echo "python3-config --includes: $(python3-config --includes)"
echo "python3-config --libs: $(python3-config --libs)"
echo "python3-config --cflags: $(python3-config --cflags)"
echo "python3-config --ldflags: $(python3-config --ldflags)"
echo "pip3 path: $(which pip3)"
python3 -c 'import numpy as np; print("np.__version__:", np.__version__, np.get_include())'
echo "pytest path: $(which pytest)"
echo "pytest version: $(pytest --version)"
echo "clang-tidy path: $(which clang-tidy)"
echo "clang-tidy version: $(clang-tidy -version)"
echo "flake8 path: $(which flake8)"
echo "flake8 version: $(flake8 --version)"
- name: setup.py install build_ext
run: |
sudo python3 setup.py install build_ext \
--cmake-args="${JOB_CMAKE_ARGS} -DPYTHON_EXECUTABLE=$(which python3) -DUSE_PYTEST_HELPER_BINDING=ON" \
--make-args="VERBOSE=1"
- name: pytest
run: |
rm -rf tmp/
mkdir -p tmp/
cp -a tests tmp/
cd tmp/
python3 -c 'import os; print(os.getcwd())'
python3 -c "import modmesh; print(modmesh.__file__)"
python3 -c "import _modmesh; print(_modmesh.__file__)"
# The following command is the original commend, and it will fail on pytest == 8.0.0 .
# pytest --rootdir=/tmp -v
# Here is the issue and temporary solution: https://github.com/pytest-dev/pytest/issues/11781
# The alternative command to solve the issue is ```pytest --rootdir=. -v```.
pytest --rootdir=. -v
cd ..
nouse_install_macos:
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && vars.MMGH_NIGHTLY == 'enable') }}
name: nouse_install_${{ matrix.os }}_Release
runs-on: ${{ matrix.os }}
env:
JOB_CMAKE_ARGS: -DBUILD_QT=OFF -DUSE_CLANG_TIDY=OFF -DCMAKE_BUILD_TYPE=Release
strategy:
matrix:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
os: [macos-13]
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: event name
run: |
echo "github.event_name: ${{ github.event_name }}"
- name: dependency by pip
run: |
echo "which python3: $(which python3)"
ls -al $(which python3)
python3 -m pip -v install --upgrade setuptools
python3 -m pip -v install --upgrade wheel # required by "--no-use-pep517"
# TODO:
# This issue was linked to #213
# temporary remove pip upgrade, due to latest pip will let cmake
# fail to find Numpy
# python3 -m pip -v install --upgrade pip
python3 -m pip -v install --upgrade numpy pytest flake8 jsonschema
- name: dependency by manual script
run: sudo ${GITHUB_WORKSPACE}/contrib/dependency/install.sh pybind11
- name: show dependency
# Copy the commands from contrib/dependency/showdep.sh
run: |
echo "gcc path: $(which gcc)"
echo "gcc version: $(gcc --version)"
echo "cmake path: $(which cmake)"
echo "cmake version: $(cmake --version)"
echo "python3 path: $(which python3)"
echo "python3 version: $(python3 --version)"
echo "python3-config --prefix: $(python3-config --prefix)"
echo "python3-config --exec-prefix: $(python3-config --exec-prefix)"
echo "python3-config --includes: $(python3-config --includes)"
echo "python3-config --libs: $(python3-config --libs)"
echo "python3-config --cflags: $(python3-config --cflags)"
echo "python3-config --ldflags: $(python3-config --ldflags)"
echo "pip3 path: $(which pip3)"
python3 -c 'import numpy as np; print("np.__version__:", np.__version__, np.get_include())'
echo "pytest path: $(which pytest)"
echo "pytest version: $(pytest --version)"
echo "clang-tidy path: $(which clang-tidy)"
echo "clang-tidy version: $(clang-tidy -version)"
echo "flake8 path: $(which flake8)"
echo "flake8 version: $(flake8 --version)"
- name: setup.py install build_ext
run: |
# Using pip install instead of legacy install
# ref: https://stackoverflow.com/questions/52375693/troubleshooting-pkg-resources-distributionnotfound-error
python3 -m pip install -v . --no-use-pep517 --global-option=build_ext \
--global-option="--cmake-args=${JOB_CMAKE_ARGS} -DPYTHON_EXECUTABLE=$(which python3) -DUSE_PYTEST_HELPER_BINDING=ON" \
--global-option="--make-args="VERBOSE=1""
- name: pytest
run: |
rm -rf tmp/
mkdir -p tmp/
cp -a tests tmp/
cd tmp/
python3 -c 'import os; print(os.getcwd())'
python3 -c "import modmesh; print(modmesh.__file__)"
python3 -c "import _modmesh; print(_modmesh.__file__)"
# The following command is the original commend, and it will fail on pytest == 8.0.0 .
# pytest --rootdir=/tmp -v
# Here is the issue and temporary solution: https://github.com/pytest-dev/pytest/issues/11781
# The alternative command to solve the issue is ```pytest --rootdir=. -v``` .
pytest --rootdir=. -v
cd ..