|
| 1 | +# Bit-exact CI: every push/PR must pass all 792 IEEE-754 tests. |
| 2 | +# |
| 3 | +# Requirements driving the setup: |
| 4 | +# - numpy must be pip-installed (its bundled OpenBLAS exposes sdot_64_ / |
| 5 | +# cblas_sgemm64_ / __svml_exp8 etc. that numpycpp resolves via dlsym) |
| 6 | +# - AVX-512 hardware is required at runtime (-mavx512f compile flag + |
| 7 | +# __attribute__((target)) guards; GitHub ubuntu-latest uses Intel Xeon |
| 8 | +# which supports AVX-512) |
| 9 | +# - pybind11, Eigen3, OpenMP needed to build the test extension module |
| 10 | + |
1 | 11 | name: CI |
2 | 12 |
|
3 | 13 | on: |
4 | 14 | push: |
5 | | - branches: [master] |
6 | | - tags: ['v*'] |
| 15 | + branches: [ master, bit-exact ] |
7 | 16 | pull_request: |
8 | | - branches: [master] |
| 17 | + branches: [ master ] |
9 | 18 |
|
10 | 19 | jobs: |
11 | | - # ---- Test: build module + run 500 precision tests -------------------------- |
12 | 20 | test: |
13 | | - runs-on: ubuntu-22.04 |
| 21 | + name: bit-exact tests — Python ${{ matrix.python }} / ${{ matrix.compiler }} |
| 22 | + runs-on: ubuntu-latest |
| 23 | + |
| 24 | + strategy: |
| 25 | + fail-fast: false |
| 26 | + matrix: |
| 27 | + include: |
| 28 | + - python: "3.10" |
| 29 | + compiler: g++ |
| 30 | + - python: "3.11" |
| 31 | + compiler: g++ |
| 32 | + - python: "3.12" |
| 33 | + compiler: g++ |
| 34 | + |
14 | 35 | steps: |
15 | 36 | - uses: actions/checkout@v4 |
16 | 37 |
|
17 | | - - name: Install dependencies |
18 | | - run: | |
19 | | - sudo apt-get update |
20 | | - sudo apt-get install -y python3 python3-pip python3-dev libeigen3-dev |
21 | | - pip3 install pybind11 numpy pytest |
22 | | -
|
23 | | - - name: Build test module |
24 | | - run: make -C tests |
| 38 | + - name: Set up Python ${{ matrix.python }} |
| 39 | + uses: actions/setup-python@v5 |
| 40 | + with: |
| 41 | + python-version: ${{ matrix.python }} |
25 | 42 |
|
26 | | - - name: Run tests |
27 | | - run: make -C tests test |
| 43 | + - name: Install Python dependencies |
| 44 | + run: pip install "numpy>=1.23" pybind11 pytest cmake |
28 | 45 |
|
29 | | - # ---- Release: build .deb and publish on tag ------------------------------- |
30 | | - release: |
31 | | - if: startsWith(github.ref, 'refs/tags/v') |
32 | | - needs: test |
33 | | - runs-on: ubuntu-22.04 |
34 | | - steps: |
35 | | - - uses: actions/checkout@v4 |
| 46 | + - name: Install system dependencies |
| 47 | + run: | |
| 48 | + sudo apt-get update -qq |
| 49 | + sudo apt-get install -y libeigen3-dev libgomp1 libgomp1-dev |
36 | 50 |
|
37 | | - - name: Build .deb |
| 51 | + - name: Verify AVX-512 support |
38 | 52 | run: | |
39 | | - mkdir build && cd build |
40 | | - cmake .. -DCMAKE_BUILD_TYPE=Release |
41 | | - make deb |
| 53 | + grep -q avx512f /proc/cpuinfo \ |
| 54 | + && echo "✓ AVX-512 supported" \ |
| 55 | + || (echo "✗ AVX-512 not detected — tests may SIGILL"; exit 1) |
42 | 56 |
|
43 | | - - name: Publish release |
44 | | - uses: softprops/action-gh-release@v2 |
45 | | - with: |
46 | | - files: build/numpycpp-dev-*.deb |
47 | | - generate_release_notes: true |
| 57 | + - name: Configure |
| 58 | + run: cmake -S tests -B tests/build -DCMAKE_BUILD_TYPE=Release |
48 | 59 | env: |
49 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + CXX: ${{ matrix.compiler }} |
| 61 | + |
| 62 | + - name: Build |
| 63 | + run: cmake --build tests/build -j$(nproc) |
| 64 | + |
| 65 | + - name: Run bit-exact tests |
| 66 | + run: | |
| 67 | + cd tests |
| 68 | + python -m pytest test_all.py -q --tb=short --no-header |
0 commit comments