diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e9dcb7..abb6af3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,32 +69,6 @@ jobs: conda-build: defaults: {run: {shell: 'bash -el {0}'}} runs-on: ${{ matrix.os }}-${{ matrix.os == 'windows' && '2022' || 'latest' }} - strategy: - matrix: - os: [ubuntu, windows] - steps: - - uses: actions/checkout@v4 - with: {fetch-depth: 0, submodules: recursive} - - if: matrix.os == 'windows' - uses: ilammy/msvc-dev-cmd@v1 - - uses: conda-incubator/setup-miniconda@v3 - with: - python-version: 3.12 - mamba-version: "*" - channels: conda-forge - conda-remove-defaults: "true" - - run: conda install boa conda-verify - - name: conda build - run: > - conda mambabuild -c conda-forge --override-channels --output-folder dist recipe --no-test - - uses: actions/upload-artifact@v4 - with: - name: ccpi-regulariser-${{ matrix.os }} - path: dist/*/ccpi-regulariser-*.tar.bz2 - conda-test: - defaults: {run: {shell: 'bash -el {0}'}} - runs-on: ${{ matrix.os }}-latest - needs: [conda-build] strategy: matrix: python-version: ['3.10', 3.11, 3.12] # parallelise conda_build_config.yaml @@ -103,17 +77,16 @@ jobs: - {python-version: 3.13, os: ubuntu} steps: - uses: actions/checkout@v4 + with: {fetch-depth: 0, submodules: recursive} + - if: matrix.os == 'windows' + uses: ilammy/msvc-dev-cmd@v1 - uses: conda-incubator/setup-miniconda@v3 with: python-version: ${{ matrix.python-version }} mamba-version: "*" channels: conda-forge conda-remove-defaults: "true" - - uses: actions/download-artifact@v4 - with: - name: ccpi-regulariser-${{ matrix.os }} - path: dist - - name: conda test + - name: conda build run: | if test ${{ matrix.python-version }} = 3.13; then BUILD_DEP=conda-build @@ -122,13 +95,18 @@ jobs: BUILD_DEP=boa BUILD_CMD="conda mambabuild" fi - conda install $BUILD_DEP - $BUILD_CMD -c conda-forge --override-channels dist/*/ccpi-regulariser-*-cpu_h*.tar.bz2 --test --python=${{ matrix.python-version }} + conda install $BUILD_DEP conda-verify + $BUILD_CMD -c conda-forge --override-channels --output-folder dist recipe --python=${{ matrix.python-version }} --no-test + $BUILD_CMD -c conda-forge --override-channels --test dist/*/ccpi-regulariser-*-cpu_*.tar.bz2 + - uses: actions/upload-artifact@v4 + with: + name: ccpi-regulariser-py${{ matrix.python-version}}-${{ matrix.os }} + path: dist/*/ccpi-regulariser-*.tar.bz2 conda-upload: if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') defaults: {run: {shell: 'bash -el {0}', working-directory: dist}} runs-on: ubuntu-latest - needs: conda-test + needs: conda-build steps: - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v3 @@ -138,7 +116,7 @@ jobs: conda-remove-defaults: "true" - uses: actions/download-artifact@v4 with: {pattern: ccpi-regulariser-*, path: dist, merge-multiple: true} - - run: conda install anaconda-client + - run: mamba install anaconda-client - name: anaconda upload -c ccpi run: > anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force @@ -152,6 +130,6 @@ jobs: 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-test] + needs: [test-cuda, test, conda-build] runs-on: ubuntu-latest steps: [{run: echo success}] diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 176d25d..bd6b93c 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,3 +1,8 @@ +python: + - 3.10 + - 3.11 + - 3.12 + - 3.13 cuda_compiler_version: - None - 12.9 diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4c52569..1dd7283 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -13,7 +13,6 @@ package: build: preserve_egg_dir: False number: {{ build_number }} - noarch: python run_exports: - {{ pin_subpackage(project.get('name'), max_pin='x.x') }} - {{ project.get('name') }} =*=cuda* # [cuda_compiler_version != "None"] @@ -40,20 +39,21 @@ requirements: build: - cmake - ninja - - python # [build_platform != target_platform] - {{ compiler('cxx') }} #- {{ compiler('cuda') }} # [cuda_compiler_version != "None"] - cuda-compiler ~={{ cuda_compiler_version }} # [cuda_compiler_version != "None"] host: - - python >=3.10 + - python x.x - llvm-openmp - setuptools - pip - cuda-cccl # [cuda_compiler_version != "None"] - cuda-version {{ cuda_compiler_version }} # [cuda_compiler_version != "None"] run: - - python >=3.10 - - numpy + - {{ pin_compatible('python', min_pin='x.x', max_pin='x') }} + {% for dep in project.get("dependencies") %} + - {{ dep.lower() }} + {% endfor %} - __cuda # [cuda_compiler_version != "None"] - {{ pin_compatible('cuda-version', min_pin='x', max_pin='x') }} # [cuda_compiler_version != "None"]