Skip to content

Commit

Permalink
CI: add windows
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Aug 30, 2024
1 parent 8ac069d commit 3896d09
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 3896d09

Please sign in to comment.