From 3896d09f437d5c85c055fa83b40dc3ca02a463ee Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 30 Aug 2024 10:52:15 +0100 Subject: [PATCH] CI: add windows --- .github/workflows/build.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c30ef6e4..8e57f2636 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,10 +67,8 @@ jobs: strategy: matrix: include: - - python-version: '3.10' - numpy-version: 1.23 - - python-version: 3.12 - numpy-version: 1.26 + - {python-version: '3.10', numpy-version: 1.23} + - {python-version: 3.12, numpy-version: 1.26} steps: - uses: actions/checkout@v4 with: {fetch-depth: 0, submodules: recursive} @@ -92,27 +90,31 @@ jobs: outputs: python-version: ${{ steps.matrix.outputs.python-version }} numpy-version: ${{ steps.matrix.outputs.numpy-version }} + os: ${{ steps.matrix.outputs.os }} steps: - id: matrix run: | if ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') }}; then echo "python-version=['3.10', 3.11]" >> $GITHUB_OUTPUT echo "numpy-version=[1.23, 1.24, 1.25, 1.26]" >> $GITHUB_OUTPUT + echo "os=[ubuntu-latest, windows-latest]" >> $GITHUB_OUTPUT else echo "python-version=['3.10']" >> $GITHUB_OUTPUT echo "numpy-version=[1.23]" >> $GITHUB_OUTPUT + echo "os=[ubuntu-latest]" >> $GITHUB_OUTPUT fi conda: defaults: {run: {shell: 'bash -el {0}'}} - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} needs: conda-matrix strategy: matrix: python-version: ${{ fromJson(needs.conda-matrix.outputs.python-version) }} numpy-version: ${{ fromJson(needs.conda-matrix.outputs.numpy-version) }} + os: ${{ fromJson(needs.conda-matrix.outputs.os) }} include: - - python-version: 3.12 - numpy-version: 1.26 + - {python-version: 3.12, numpy-version: 1.26, os: ubuntu-latest} + - {python-version: 3.12, numpy-version: 1.26, os: windows-latest} steps: - uses: actions/checkout@v4 with: @@ -132,20 +134,22 @@ jobs: - uses: actions/upload-artifact@v4 with: name: cil-package-py${{ matrix.python-version }}-np${{ matrix.numpy-version }} - path: recipe/linux-64/cil* + path: recipe/*/cil-*.tar.bz2 - name: anaconda upload -c ccpi if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') run: > anaconda -v -t ${{ secrets.CCPI_CONDA_TOKEN }} upload --force --label ${{ startsWith(github.ref, 'refs/tags') && 'main' || 'dev' }} - recipe/linux-64/cil* + recipe/*/cil-*.tar.bz2 - name: conda upload -c tomography.stfc.ac.uk/conda if: startsWith(github.ref, 'refs/tags') run: | echo '${{ secrets.STFC_SSH_KEY }}' > ./key chmod 600 ./key - rsync -e 'ssh -o StrictHostKeyChecking=no -i ./key' -P recipe/linux-64/cil* \ - '${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}/linux-64/' + for plat in linux-64 win-64; do + rsync -e 'ssh -o StrictHostKeyChecking=no -i ./key' -P recipe/$plat/cil-*.tar.bz2 \ + '${{ secrets.STFC_SSH_HOST }}:${{ secrets.STFC_SSH_CONDA_DIR }}/$plat/' + done conda-reindex: if: startsWith(github.ref, 'refs/tags') needs: conda