CI: add self-hosted CUDA runners #8
Workflow file for this run
This file contains 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
name: build | |
on: | |
release: | |
types: [published] | |
push: | |
branches: [master] | |
tags: ['**'] | |
pull_request: | |
branches: [master] | |
jobs: | |
test-cuda: | |
defaults: {run: {shell: 'bash -el {0}'}} | |
runs-on: [self-hosted, python, cuda] | |
strategy: | |
matrix: | |
python-version: [3.9] | |
numpy-version: [1.22] | |
steps: | |
- uses: actions/checkout@v4 | |
with: {fetch-depth: 0, submodules: recursive} | |
- id: reqs | |
name: set requirements | |
run: | | |
envname="${GITHUB_REPOSITORY##*/}-${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}" | |
echo "envname=$envname" >> $GITHUB_OUTPUT | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
activate-environment: ${{ steps.reqs.outputs.envname }} | |
run-post: false | |
- id: build | |
name: build | |
run: | | |
conda activate "${{ steps.reqs.outputs.envname }}" | |
cmake -S . -B ./build_proj -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MATLAB_WRAPPER=OFF -DBUILD_PYTHON_WRAPPER=ON -DBUILD_CUDA=ON -DCMAKE_INSTALL_PREFIX=./install | |
cmake --build ./build_proj --target install | |
pip install ./src/Python | |
- name: test | |
run: | | |
conda activate "${{ steps.reqs.outputs.envname }}" | |
PYTHONPATH=./src/Python python -m unittest discover ./test | |
- if: always() | |
name: Post Run conda-incubator/setup-miniconda@v3 | |
run: | | |
conda deactivate | |
conda env remove -n "${{ steps.reqs.outputs.envname }}" | |
sed -i '/${{ steps.reqs.outputs.envname }}/d' ~/.profile | |
test: | |
defaults: {run: {shell: 'bash -el {0}'}} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- python-version: 3.8 | |
numpy-version: 1.21 | |
- python-version: '3.10' | |
numpy-version: 1.24 | |
steps: | |
- uses: actions/checkout@v4 | |
with: {fetch-depth: 0, submodules: recursive} | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: build | |
run: | | |
cmake -S . -B ./build_proj -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MATLAB_WRAPPER=OFF -DBUILD_PYTHON_WRAPPER=ON -DBUILD_CUDA=OFF -DCMAKE_INSTALL_PREFIX=./install | |
cmake --build ./build_proj --target install | |
pip install ./src/Python | |
- name: test | |
run: PYTHONPATH=./src/Python python -m unittest discover ./test | |
conda: | |
defaults: {run: {shell: 'bash -el {0}'}} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
numpy-version: [1.22] | |
steps: | |
- uses: actions/checkout@v4 | |
with: {fetch-depth: 0, submodules: recursive} | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
mamba-version: "*" | |
channels: conda-forge | |
- name: conda build & test | |
working-directory: recipe | |
run: | | |
conda install boa | |
conda mambabuild . -c conda-forge -c ccpi --python=${{ matrix.python-version }} --numpy=${{ matrix.numpy-version }} --output-folder . | |
- name: Upload artifact of the conda package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ccpi-regulariser-package | |
path: recipe/linux-64/ccpi-regulariser* | |
pass: | |
needs: [test-cuda, test, conda] | |
runs-on: ubuntu-latest | |
steps: [{run: echo success}] |