-
Notifications
You must be signed in to change notification settings - Fork 7
213 lines (178 loc) · 7.31 KB
/
tests.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: tests
on:
push:
pull_request:
jobs:
cpptests:
name: C++ Tests on ${{ matrix.os }} ${{ matrix.description }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: windows-latest
mingw-version: "13.2.0"
description: "MinGW 13"
cmake-flags: '-G "MinGW Makefiles"'
- os: ubuntu-20.04
llvm-version: "8"
description: "LLVM 8"
# gcov_executable: "llvm-cov gcov"
- os: ubuntu-20.04
gcc-version: "8"
description: "GCC 8"
- os: ubuntu-latest
gcc-version: "9"
# test minimum CMake version specified in CMakeLists.txt
cmake-version: '3.14'
description: "GCC 9"
gcov_executable: "gcov"
- os: ubuntu-latest
gcc-version: "13"
cmake-version: '3.14'
description: "GCC 13"
- os: macos-latest
# gcov_executable: "xcrun llvm-cov gcov"
steps:
- uses: actions/checkout@v4
- name: Setup GCC
uses: egor-tensin/setup-gcc@v1
if: ${{ matrix.gcc-version != '' }}
with:
version: ${{ matrix.gcc-version }}
- name: Setup MinGW (Windows)
if: contains(matrix.os, 'windows') && matrix.mingw-version != ''
run: |
choco install --no-progress mingw --version ${{ matrix.mingw-version }}
Add-Content $env:GITHUB_PATH "C:\ProgramData\mingw64\mingw64\bin"
- name: Setup LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
if: ${{ matrix.llvm-version != '' }}
with:
version: ${{ matrix.llvm-version }}
env: true
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
if: ${{ matrix.cmake-version != '' }}
with:
cmake-version: ${{ matrix.cmake-version }}
# test that the examples build
- name: Build examples
working-directory: examples
run: |
cmake -S . -B cmake-build-debug/ -D CMAKE_BUILD_TYPE=Debug ${{ matrix.cmake-flags }}
cmake --build cmake-build-debug/
- name: Install Integrations (Ubuntu)
if: contains(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y libarmadillo-dev
- name: Install GraphBLAS (ubuntu)
if: contains(matrix.os, 'ubuntu')
# Install pre-built GraphBLAS from conda-forge because GraphBLAS packages in Ubuntu repos are too old to be useful.
# See LAGraph's workflow: https://github.com/GraphBLAS/LAGraph/blob/stable/.github/workflows/build.yml
run: |
mkdir -p grb
cd grb
wget --quiet https://anaconda.org/conda-forge/graphblas/8.2.1/download/linux-64/graphblas-8.2.1-h59595ed_0.conda
unzip graphblas-8.2.1-h59595ed_0.conda
tar xvf pkg-graphblas-8.2.1-h59595ed_0.tar.zst
cd ..
echo "FMM_CMAKE_FLAGS=-DCMAKE_MODULE_PATH=${{ github.workspace }}/grb/lib/cmake/SuiteSparse -DGraphBLAS_ROOT=${{ github.workspace }}/grb/" >> $GITHUB_ENV
- name: Install GraphBLAS (macOS)
if: contains(matrix.os, 'macos')
# install suite-sparse which includes GraphBLAS and also FindGraphBLAS.cmake
run: brew install suite-sparse
- name: Configure
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DFAST_MATRIX_MARKET_TEST=ON -DFAST_MATRIX_MARKET_TEST_COVERAGE=ON ${{ env.FMM_CMAKE_FLAGS }} ${{ matrix.cmake-flags }}
- name: Build
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
run: cmake --build build --config Debug
- name: Test
working-directory: build
run: ctest -C Debug --output-on-failure --verbose
- name: Create code coverage report (gcov)
if: matrix.gcov_executable != ''
working-directory: build
run: |
pip install gcovr
gcovr --delete --root ../../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}' --gcov-ignore-parse-errors=negative_hits.warn_once_per_file
- name: Upload Coverage to Codecov
if: matrix.gcov_executable != ''
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
pythontests:
name: Python ${{ matrix.python-version }} Tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.11', 'pypy-3.9']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Python Build
# On some platforms pip uses a temporary build directory but only copies the python/ directory there.
# This breaks the relative symbolic links to the C++ library. Workaround is to pass the checkout directory
# as an environment variable so CMakeLists.txt can read it and know where to import the C++ library from.
run: |
export FMM_PYTHON_DIR="$(pwd)" && pip install python/.[testmin] -v && pip install pytest-subtests
shell: bash
- name: Python Test Minimums
working-directory: python/tests
run: pytest
- name: Install NumPy
# --only-binary disables compiling the package from source if a binary wheel is not available, such as some versions of PyPy
# `--pre` to test against RCs, if any
run: pip install --pre --only-binary ":all:" numpy || true
- name: Install SciPy
# --only-binary disables compiling the package from source if a binary wheel is not available, such as PyPy
# `--pre` to test against RCs, if any
run: pip install --pre --only-binary ":all:" scipy || true
- name: Python Test
working-directory: python/tests
run: pytest
- name: Python Test with Coverage
if: contains(matrix.os, 'ubuntu')
working-directory: python/tests
run: |
pip install pytest-cov
pytest --cov=fast_matrix_market --cov-report term --cov-report=xml
- name: Upload Coverage to Codecov
if: contains(matrix.os, 'ubuntu')
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
directory: python/tests
#################################################################################
linux_32bit:
name: Tests on 32-bit Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build + test
run: |
set -euo pipefail
docker pull quay.io/pypa/manylinux2014_i686
docker run -v $(pwd):/fmm --platform=linux/i386 quay.io/pypa/manylinux2014_i686 /bin/bash -c "cd /fmm && \
uname -a && \
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DFAST_MATRIX_MARKET_TEST=ON && \
cmake --build build --config Debug && \
cd build && \
ctest -C Debug --output-on-failure --verbose && \
cd ../ && \
python3.9 -m venv env && \
source env/bin/activate && \
python -m pip install python/ -v &&\
python -m pip install --only-binary :all: numpy scipy pytest pytest-subtests && \
cd python/tests/ && \
pytest -v"