|
8 | 8 | pull_request:
|
9 | 9 | branches: [master]
|
10 | 10 | jobs:
|
| 11 | + test-cuda: |
| 12 | + defaults: {run: {shell: 'bash -el {0}'}} |
| 13 | + runs-on: [self-hosted, python, cuda] |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + python-version: [3.9] |
| 17 | + numpy-version: [1.22] |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + with: {fetch-depth: 0, submodules: recursive} |
| 21 | + - id: reqs |
| 22 | + name: set requirements |
| 23 | + run: | |
| 24 | + envname="${GITHUB_REPOSITORY##*/}-${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}" |
| 25 | + echo "envname=$envname" >> $GITHUB_OUTPUT |
| 26 | + - uses: conda-incubator/setup-miniconda@v3 |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.python-version }} |
| 29 | + activate-environment: ${{ steps.reqs.outputs.envname }} |
| 30 | + run-post: false |
| 31 | + - id: build |
| 32 | + name: build |
| 33 | + run: | |
| 34 | + conda activate "${{ steps.reqs.outputs.envname }}" |
| 35 | + which cmake || conda install -yq cmake |
| 36 | + cmake -S . -B ./build_proj -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MATLAB_WRAPPER=OFF -DBUILD_PYTHON_WRAPPER=ON -DBUILD_CUDA=ON -DCMAKE_INSTALL_PREFIX=./install |
| 37 | + cmake --build ./build_proj --target install |
| 38 | + pip install ./src/Python |
| 39 | + - name: test |
| 40 | + run: | |
| 41 | + conda activate "${{ steps.reqs.outputs.envname }}" |
| 42 | + PYTHONPATH=./src/Python python -m unittest discover ./test |
| 43 | + - if: always() |
| 44 | + name: Post Run conda-incubator/setup-miniconda@v3 |
| 45 | + run: | |
| 46 | + conda deactivate |
| 47 | + sed -i '/${{ steps.reqs.outputs.envname }}/d' ~/.profile |
| 48 | + conda env remove -n "${{ steps.reqs.outputs.envname }}" |
11 | 49 | test:
|
12 | 50 | defaults: {run: {shell: 'bash -el {0}'}}
|
13 | 51 | runs-on: ubuntu-latest
|
|
57 | 95 | name: ccpi-regulariser-package
|
58 | 96 | path: recipe/linux-64/ccpi-regulariser*
|
59 | 97 | pass:
|
60 |
| - needs: [test, conda] |
| 98 | + needs: [test-cuda, test, conda] |
61 | 99 | runs-on: ubuntu-latest
|
62 | 100 | steps: [{run: echo success}]
|
0 commit comments