make codes a package and installable with pip, add unit tests #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Install and Test on Linux | |
| on: | |
| push: | |
| branches: | |
| - '*' # Runs on all branches | |
| # - 'draft_with_heat_transfer' | |
| pull_request: | |
| branches: | |
| - '*' # Runs on all pull requests | |
| #- 'draft_with_heat_transfer' | |
| # jobs: | |
| # test-linux: | |
| # runs-on: ubuntu-latest | |
| # defaults: | |
| # run: | |
| # shell: bash -l {0} # <-- Add this to make every run block use full bash login shell | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v2 | |
| # - name: Set up Conda (Linux) | |
| # uses: conda-incubator/setup-miniconda@v2 | |
| # with: | |
| # miniconda-version: 'latest' | |
| # python-version: '3.10' | |
| # auto-activate-base: false | |
| # - name: Create Conda environment and install lue | |
| # run: | | |
| # conda create --name lue python=3.10 | |
| # conda activate lue | |
| # conda install -c conda-forge lue | |
| # echo "Installation complete!" | |
| # export LD_PRELOAD=$(find $CONDA_PREFIX -name libtcmalloc_minimal.so.4) | |
| # python -c 'import lue; print(f"lue: {lue.__version__} ({lue.git_short_sha1})")' | |
| # - name: Run Unit Tests | |
| # run: | | |
| # conda activate lue | |
| # export LD_PRELOAD=$(find $CONDA_PREFIX -name libtcmalloc_minimal.so.4) | |
| # python -c "from lue import __version__; print('LUE version:', __version__)" | |
| # # python -m unittest -v test.model_test.TestPackage.test_second_derivatives_in_y | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| auto-update-conda: true | |
| conda-solver: "libmamba" | |
| python-version: 3.12 | |
| - name: Create Conda environment and install lue | |
| run: | | |
| conda env create --file=environment/configuration/conda_environment.yml | |
| conda activate lue | |
| export LD_PRELOAD=$(find $CONDA_PREFIX -name libtcmalloc_minimal.so.4) | |
| python -c 'import lue; print(f"lue: {lue.__version__} ({lue.git_short_sha1})")' | |
| - name: run test units | |
| run: | | |
| conda activate lue | |
| export LD_PRELOAD=$(find $CONDA_PREFIX -name libtcmalloc_minimal.so.4) | |
| # python -m unittest -v test.model_test.TestPackage.test_second_derivatives_in_y | |
| # python -m unittest -v test.model_test.TestPackage.test_boundary_set | |
| python -m unittest test.model_test -v |