-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 2.73 KB
/
Copy pathci.yml
File metadata and controls
86 lines (73 loc) · 2.73 KB
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
name: CI
on:
push: { branches: [master], tags: ['v*'] }
pull_request: { branches: [master] }
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-dev libeigen3-dev
- name: Install numpycpp
run: |
curl -sLO https://github.com/array2d/numpycpp/releases/latest/download/numpycpp-dev-1.21.2-Linux.deb
sudo dpkg -i numpycpp-dev-1.21.2-Linux.deb
- name: Install Python dependencies
run: pip3 install pybind11 numpy scipy pytest
- name: Detect CPU features
id: cpu
run: |
AVX512=$(grep -c avx512f /proc/cpuinfo || true)
echo "avx512=$AVX512" >> "$GITHUB_OUTPUT"
- name: Build test module
run: |
if [ "${{ steps.cpu.outputs.avx512 }}" = "0" ]; then
# No AVX-512: drop -mavx512f, keep SSE4.1 + AVX2
make -C tests CXXFLAGS="-std=c++17 -O2 -fPIC -fopenmp -ffp-contract=off \
-ffloat-store -msse4.1 -mavx2 \
-fno-builtin-exp -fno-builtin-log -fno-builtin-sin \
-fno-builtin-cos -fno-builtin-tan -fno-builtin-pow \
-fno-builtin-sqrt -fno-builtin-atan2 -fno-builtin-log2 \
-fno-builtin-log10 -fno-builtin-asin -fno-builtin-acos \
-fno-builtin-atan -fno-builtin-exp2"
else
make -C tests
fi
- name: Run tests & export ULP report
run: |
cd tests
python3 -m pytest ../tests/test_all.py -q --tb=short --no-header \
2>../doc/ulp_report.txt || true
echo "--- ULP report ---"
cat ../doc/ulp_report.txt | tail -60
- name: Upload ULP report
if: always()
uses: actions/upload-artifact@v4
with:
name: ulp-report
path: |
doc/ulp_report.csv
doc/ulp_report.txt
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libeigen3-dev
curl -sLO https://github.com/array2d/numpycpp/releases/latest/download/numpycpp-dev-1.21.2-Linux.deb
sudo dpkg -i numpycpp-dev-1.21.2-Linux.deb
- name: Build .deb
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release && make deb
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: build/scipycpp-dev-*.deb
generate_release_notes: true
env: { GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }