1
1
name : Sharpy CI
2
2
run-name : ${{ github.actor }} CI for sharpy
3
3
permissions : read-all
4
+
4
5
on :
5
6
push :
6
7
branches :
7
8
- main
8
9
pull_request :
10
+
9
11
defaults :
10
12
run :
11
- shell : bash
13
+ shell : bash -l {0}
14
+
12
15
env :
13
16
IMEX_CACHE_NUMBER : 4 # Increase to reset cache
17
+
14
18
jobs :
15
19
build_and_test :
16
20
runs-on : ubuntu-22.04
25
29
run : |
26
30
INSTALLED_DIR="$(realpath $GITHUB_WORKSPACE)/third_party/install"
27
31
echo "INSTALLED_DIR=$INSTALLED_DIR" >> "$GITHUB_ENV"
28
- CONDA_ROOT="$(realpath $GITHUB_WORKSPACE/..)/install/miniconda3"
29
- echo "CONDA_ROOT=$CONDA_ROOT" >> "$GITHUB_ENV"
30
32
echo 'IMEX_SHA<<EOF' >> $GITHUB_ENV
31
33
cat imex_version.txt >> $GITHUB_ENV
32
34
echo 'EOF' >> $GITHUB_ENV
@@ -36,29 +38,17 @@ jobs:
36
38
with :
37
39
path : third_party/install/**
38
40
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
55
46
- name : Build SHARPY
56
47
run : |
57
48
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
60
50
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 .
62
52
- name : Save IMEX cache
63
53
uses : actions/cache/save@v3
64
54
if : steps.cache-imex.outputs.cache-hit != 'true'
@@ -67,14 +57,10 @@ jobs:
67
57
key : ${{ runner.os }}-build-imex-${{ env.IMEX_CACHE_NUMBER }}-${{ env.IMEX_SHA }}
68
58
- name : Install SHARPY
69
59
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
73
61
conda activate sharpy
74
62
- name : Test SHARPY (pytest)
75
63
run : |
76
- export PATH=$CONDA_ROOT/condabin:$CONDA_ROOT/bin:${PATH}
77
- eval "$($CONDA_ROOT/bin/python -m conda shell.bash hook)"
78
64
conda activate sharpy
79
65
cd test
80
66
pytest . -v -s --timeout=30
85
71
cd -
86
72
- name : Run examples
87
73
run : |
88
- export PATH=$CONDA_ROOT/condabin:$CONDA_ROOT/bin:${PATH}
89
- eval "$($CONDA_ROOT/bin/python -m conda shell.bash hook)"
90
74
conda activate sharpy
91
75
cd examples
92
76
SHARPY_FALLBACK=numpy python -u ./stencil-2d.py 5 1024 star 4
0 commit comments