|
| 1 | +name: Test of conda recipe build |
| 2 | +'on': |
| 3 | + push: |
| 4 | + branches-ignore: |
| 5 | + - gh-pages |
| 6 | + tags: |
| 7 | + - '*' |
| 8 | + schedule: |
| 9 | + - cron: 0 10 * * 1 |
| 10 | +jobs: |
| 11 | + build_conda_recipe: |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + defaults: |
| 14 | + run: |
| 15 | + shell: bash -el {0} |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + sundials-version: [latest] |
| 19 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 20 | + fail-fast: false |
| 21 | + steps: |
| 22 | + - name: Check out repository code |
| 23 | + uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + submodules: true |
| 26 | + |
| 27 | + ################################### |
| 28 | + # CONDA SETUP |
| 29 | + ################################### |
| 30 | + - name: Set up MSVC Compiler on windows |
| 31 | + uses: ilammy/msvc-dev-cmd@v1 |
| 32 | + if: matrix.os == 'windows-latest' |
| 33 | + - name: Set up miniconda test environment (W/O MPI) |
| 34 | + uses: conda-incubator/setup-miniconda@v3 |
| 35 | + with: |
| 36 | + activate-environment: "" |
| 37 | + auto-activate-base: true |
| 38 | + auto-update-conda: true |
| 39 | + channels: conda-forge |
| 40 | + channel-priority: strict |
| 41 | + miniforge-variant: Miniforge3 |
| 42 | + miniforge-version: latest |
| 43 | + conda-remove-defaults: true |
| 44 | + - name: Install conda-build |
| 45 | + run: | |
| 46 | + conda info |
| 47 | + conda list |
| 48 | + conda install conda-build py-lief=0.14 cmake numpy -y |
| 49 | + - name: Check conda installation |
| 50 | + run: | |
| 51 | + conda info |
| 52 | + conda list |
| 53 | + - name: Build conda recipe |
| 54 | + run: | |
| 55 | + conda-build --use-local --no-anaconda-upload --output-folder ./local_channel/ recipe/ |
| 56 | + - name: Install from local conda recipe |
| 57 | + run: | |
| 58 | + conda install -c ./local_channel ePhotosynthesis |
| 59 | + conda list |
| 60 | +
|
| 61 | + ################################### |
| 62 | + # Test |
| 63 | + ################################### |
| 64 | + - name: Test ePhoto executable install by conda |
| 65 | + run: | |
| 66 | + ePhoto -d 4 --evn tests/data/InputEvn.txt --grn tests/data/InputGRNC.txt --enzyme tests/data/InputEnzyme.txt --atpcost tests/data/InputATPCost.txt --output output_conda.data |
| 67 | + - name: Check output from ePhoto executable install by conda |
| 68 | + run: | |
| 69 | + python scripts/devtasks.py compare-files output_conda.data --driver 4 |
| 70 | + - name: Build example against the installed library using CMake/Make (Unix) |
| 71 | + if: matrix.os != 'windows-latest' |
| 72 | + run: | |
| 73 | + conda list |
| 74 | + cd tests/external |
| 75 | + mkdir build |
| 76 | + cd build |
| 77 | + cmake .. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON |
| 78 | + cmake --build . |
| 79 | + - name: Build example against the installed library using CMake/Ninja (Windows) |
| 80 | + if: matrix.os == 'windows-latest' |
| 81 | + run: | |
| 82 | + conda list |
| 83 | + cd tests/external |
| 84 | + mkdir build |
| 85 | + cd build |
| 86 | + cmake -GNinja -D CMAKE_BUILD_TYPE=Release -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON .. |
| 87 | + cmake --build . |
| 88 | + - name: Test built example executable (Unix) |
| 89 | + if: matrix.os != 'windows-latest' |
| 90 | + run: | |
| 91 | + cd tests |
| 92 | + ./external/build/example |
| 93 | + - name: Test built example executable (Windows) |
| 94 | + if: matrix.os == 'windows-latest' |
| 95 | + run: | |
| 96 | + cd tests |
| 97 | + ls |
| 98 | + ls ./external/build/ |
| 99 | + # ./external/build/Release/example |
| 100 | + ./external/build/example |
| 101 | + - name: Check built example executable output |
| 102 | + run: | |
| 103 | + python scripts/devtasks.py compare-files tests/example_output.data --driver 4 |
0 commit comments