11name : Sharpy CI
22run-name : ${{ github.actor }} CI for sharpy
33permissions : read-all
4+
45on :
56 push :
67 branches :
78 - main
89 pull_request :
10+
911defaults :
1012 run :
11- shell : bash
13+ shell : bash -l {0}
14+
1215env :
1316 IMEX_CACHE_NUMBER : 4 # Increase to reset cache
17+
1418jobs :
1519 build_and_test :
1620 runs-on : ubuntu-22.04
2529 run : |
2630 INSTALLED_DIR="$(realpath $GITHUB_WORKSPACE)/third_party/install"
2731 echo "INSTALLED_DIR=$INSTALLED_DIR" >> "$GITHUB_ENV"
28- CONDA_ROOT="$(realpath $GITHUB_WORKSPACE/..)/install/miniconda3"
29- echo "CONDA_ROOT=$CONDA_ROOT" >> "$GITHUB_ENV"
3032 echo 'IMEX_SHA<<EOF' >> $GITHUB_ENV
3133 cat imex_version.txt >> $GITHUB_ENV
3234 echo 'EOF' >> $GITHUB_ENV
@@ -36,29 +38,17 @@ jobs:
3638 with :
3739 path : third_party/install/**
3840 key : ${{ runner.os }}-build-imex-${{ env.IMEX_CACHE_NUMBER }}-${{ env.IMEX_SHA }}
39- - name : Miniconda
40- run : |
41- env
42- rm -rf $CONDA_ROOT
43- cd $GITHUB_WORKSPACE/..
44- rm -f Miniconda3-*.sh
45- # CPKG=Miniconda3-latest-Linux-x86_64.sh
46- CPKG=Miniconda3-py311_24.3.0-0-Linux-x86_64.sh
47- wget -q https://repo.anaconda.com/miniconda/$CPKG
48- bash $CPKG -u -b -f -p $CONDA_ROOT
49- export PATH=$CONDA_ROOT/condabin:$CONDA_ROOT/bin:${PATH}
50- eval "$($CONDA_ROOT/bin/python -m conda shell.bash hook)"
51- conda install -c conda-forge --override-channels python git-lfs 'conda-build<=24.1.2'
52- # aahhhh bug in conda somewhere
53- sed -i "s,\#\!/usr/bin/env python,#\!$CONDA_ROOT/bin/python," $CONDA_ROOT/*bin/conda
54- conda clean --all -y
41+ - name : Setup Miniforge
42+ uses : conda-incubator/setup-miniconda@v3
43+ with :
44+ miniforge-version : latest
45+ # environment-file: etc/example-environment.yml
5546 - name : Build SHARPY
5647 run : |
5748 env
58- export PATH=$CONDA_ROOT/condabin:$CONDA_ROOT/bin:${PATH}
59- eval "$($CONDA_ROOT/bin/python -m conda shell.bash hook)"
49+ conda install -y conda-build
6050 cd conda-recipe
61- conda build --numpy 1.26 -c conda-forge --override-channels - -no-anaconda-upload --no-test .
51+ conda build --numpy 1.26 --no-anaconda-upload --no-test .
6252 - name : Save IMEX cache
6353 uses : actions/cache/save@v3
6454 if : steps.cache-imex.outputs.cache-hit != 'true'
@@ -67,14 +57,10 @@ jobs:
6757 key : ${{ runner.os }}-build-imex-${{ env.IMEX_CACHE_NUMBER }}-${{ env.IMEX_SHA }}
6858 - name : Install SHARPY
6959 run : |
70- export PATH=$CONDA_ROOT/condabin:$CONDA_ROOT/bin:${PATH}
71- eval "$($CONDA_ROOT/bin/python -m conda shell.bash hook)"
72- conda create --use-local -c conda-forge --override-channels -n sharpy -v sharpy pytest pytest-timeout
60+ conda create --use-local -c file://${CONDA_PREFIX}/conda-bld/ -n sharpy -v sharpy pytest pytest-timeout
7361 conda activate sharpy
7462 - name : Test SHARPY (pytest)
7563 run : |
76- export PATH=$CONDA_ROOT/condabin:$CONDA_ROOT/bin:${PATH}
77- eval "$($CONDA_ROOT/bin/python -m conda shell.bash hook)"
7864 conda activate sharpy
7965 cd test
8066 pytest . -v -s --timeout=30
8571 cd -
8672 - name : Run examples
8773 run : |
88- export PATH=$CONDA_ROOT/condabin:$CONDA_ROOT/bin:${PATH}
89- eval "$($CONDA_ROOT/bin/python -m conda shell.bash hook)"
9074 conda activate sharpy
9175 cd examples
9276 SHARPY_FALLBACK=numpy python -u ./stencil-2d.py 5 1024 star 4
0 commit comments