ci: add GitHub Actions workflow + CI badge (closes #1) #70
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Bit-exact CI: every push/PR must pass all 792 IEEE-754 tests. | |
| # | |
| # Requirements driving the setup: | |
| # - numpy must be pip-installed (its bundled OpenBLAS exposes sdot_64_ / | |
| # cblas_sgemm64_ / __svml_exp8 etc. that numpycpp resolves via dlsym) | |
| # - AVX-512 hardware is required at runtime (-mavx512f compile flag + | |
| # __attribute__((target)) guards; GitHub ubuntu-latest uses Intel Xeon | |
| # which supports AVX-512) | |
| # - pybind11, Eigen3, OpenMP needed to build the test extension module | |
| name: CI | |
| on: | |
| push: | |
| branches: [ master, bit-exact ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| test: | |
| name: bit-exact tests — Python ${{ matrix.python }} / ${{ matrix.compiler }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - python: "3.10" | |
| compiler: g++ | |
| - python: "3.11" | |
| compiler: g++ | |
| - python: "3.12" | |
| compiler: g++ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install Python dependencies | |
| run: pip install "numpy>=1.23" pybind11 pytest cmake | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y libeigen3-dev libgomp1 libgomp1-dev | |
| - name: Verify AVX-512 support | |
| run: | | |
| grep -q avx512f /proc/cpuinfo \ | |
| && echo "✓ AVX-512 supported" \ | |
| || (echo "✗ AVX-512 not detected — tests may SIGILL"; exit 1) | |
| - name: Configure | |
| run: cmake -S tests -B tests/build -DCMAKE_BUILD_TYPE=Release | |
| env: | |
| CXX: ${{ matrix.compiler }} | |
| - name: Build | |
| run: cmake --build tests/build -j$(nproc) | |
| - name: Run bit-exact tests | |
| run: | | |
| cd tests | |
| python -m pytest test_all.py -q --tb=short --no-header |