|
| 1 | +name: Build project with standard clang compiler |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: [master] |
| 7 | + |
| 8 | +permissions: read-all |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-with-standard-clang: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + python: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 17 | + numpy_version: ["numpy'>=2'"] |
| 18 | + |
| 19 | + env: |
| 20 | + COMPILER_ROOT: /usr/bin |
| 21 | + |
| 22 | + defaults: |
| 23 | + run: |
| 24 | + shell: bash -el {0} |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Cancel Previous Runs |
| 28 | + uses: styfle/cancel-workflow-action@3155a141048f8f89c06b4cdae32e7853e97536bc # 0.13.0 |
| 29 | + with: |
| 30 | + access_token: ${{ github.token }} |
| 31 | + |
| 32 | + - name: Install Dependencies |
| 33 | + run: | |
| 34 | + sudo apt-get update |
| 35 | + sudo apt-get install -y clang |
| 36 | +
|
| 37 | + - name: Setup Python |
| 38 | + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 39 | + with: |
| 40 | + python-version: ${{ matrix.python }} |
| 41 | + architecture: x64 |
| 42 | + |
| 43 | + - name: Checkout repo |
| 44 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 45 | + with: |
| 46 | + fetch-depth: 0 |
| 47 | + |
| 48 | + - name: Install mkl_random dependencies |
| 49 | + run: | |
| 50 | + pip install meson-python ninja cmake cython mkl-service |
| 51 | + pip install mkl-devel |
| 52 | + pip install ${{ matrix.numpy_version }} |
| 53 | +
|
| 54 | + - name: Build mkl_random |
| 55 | + run: | |
| 56 | + export CC=${{ env.COMPILER_ROOT }}/clang |
| 57 | + export CXX=${{ env.COMPILER_ROOT }}/clang++ |
| 58 | + pip install . --no-build-isolation --no-deps --verbose |
| 59 | +
|
| 60 | + - name: Run mkl_random tests |
| 61 | + run: | |
| 62 | + pip install pytest |
| 63 | + # mkl_random cannot be installed in editable mode, we need |
| 64 | + # to change directory before importing it and running tests |
| 65 | + cd .. |
| 66 | + python -m pytest -sv --pyargs mkl_random |
0 commit comments