rattler-build, python version_independent, cuda 12/13 variants #142
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
| name: build | |
| on: | |
| release: {types: [published]} | |
| push: | |
| branches: [master] | |
| tags: ['**'] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| test-cuda: | |
| runs-on: [self-hosted, python, cuda] | |
| strategy: {matrix: {cuda-version: [12]}} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: {fetch-depth: 0, submodules: recursive} | |
| - uses: prefix-dev/rattler-build-action@v0.2.38 # https://github.com/prefix-dev/rattler-build/pull/2484 | |
| with: | |
| recipe-path: recipe.yaml | |
| build-args: --experimental --variant cuda_version_major=${{ matrix.cuda-version }} | |
| test: | |
| runs-on: ${{ matrix.os }}-${{ matrix.os == 'ubuntu' && '22.04' || '2022' }} | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.x'] # min & max supported | |
| os: [ubuntu, windows] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: {fetch-depth: 0, submodules: recursive} | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: build | |
| run: | | |
| cmake -S . -B ./output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_PYTHON_WRAPPER=ON -DBUILD_CUDA=OFF -DCMAKE_INSTALL_PREFIX=src/Python/ccpi/filters | |
| cmake --build ./output --target install | |
| pip install ./src/Python | |
| - name: test | |
| run: python -m unittest discover -v -s ./test | |
| env: {PYTHONPATH: ./src/Python} | |
| conda-build-test-ubuntu: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: {fetch-depth: 0, submodules: recursive} | |
| - uses: prefix-dev/rattler-build-action@v0.2.38 # https://github.com/prefix-dev/rattler-build/pull/2484 | |
| with: | |
| recipe-path: recipe.yaml | |
| build-args: --experimental --no-test | |
| artifact-name: conda-ubuntu | |
| - name: conda test | |
| run: rattler-build test --experimental -p output/*/*-cpu_h*.conda | |
| conda-build-test-windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| variant: [cpu, cuda] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: {fetch-depth: 0, submodules: recursive} | |
| - if: matrix.variant == 'cpu' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - uses: prefix-dev/rattler-build-action@v0.2.38 # https://github.com/prefix-dev/rattler-build/pull/2484 | |
| with: | |
| recipe-path: recipe.yaml | |
| build-args: --experimental --no-test --variant cuda_version_major=${{ matrix.variant == 'cpu' && 'None' || '12,13' }} | |
| artifact-name: conda-windows-${{ matrix.variant }} | |
| - if: matrix.variant == 'cpu' | |
| name: conda test | |
| run: rattler-build test --experimental -p output/*/*-cpu_h*.conda | |
| shell: bash | |
| conda-upload: | |
| if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') | |
| defaults: {run: {working-directory: output}} | |
| runs-on: ubuntu-slim | |
| needs: [conda-build-test-ubuntu, conda-build-test-windows] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: prefix-dev/rattler-build-action@v0.2.37 | |
| with: {setup-only: true} | |
| - uses: actions/download-artifact@v8 | |
| with: {pattern: conda-*, path: output, merge-multiple: true} | |
| - name: conda upload -c ccpi | |
| run: > | |
| rattler-build upload anaconda */*.conda -f | |
| -o ccpi -a ${{ secrets.CCPI_CONDA_TOKEN }} | |
| -c ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} | |
| - if: startsWith(github.ref, 'refs/tags') | |
| name: conda upload -c tomography.stfc.ac.uk/conda | |
| run: | | |
| echo '${{ secrets.STFC_SSH_KEY }}' > ./key | |
| chmod 600 ./key | |
| rsync -e 'ssh -o StrictHostKeyChecking=no -i ./key' -R */*.conda '${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}' | |
| ssh -o StrictHostKeyChecking=no -i ./key ${{ secrets.STFC_SSH_HOST }} \ | |
| 'bash -lic "conda index --bz2 --zst --run-exports --channeldata --rss -n ccpi ${{ secrets.STFC_SSH_CONDA_DIR }}"' | |
| pass: | |
| needs: [test-cuda, test, conda-build-test-ubuntu, conda-build-test-windows] | |
| runs-on: ubuntu-slim | |
| steps: [{run: echo success}] |