Merge pull request #703 from xpsi-group/zenodointegration #1421
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: CI Tests | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| tags: | |
| - "*" | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 5 | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Conda environment with Micromamba | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| cache-environment: true | |
| cache-environment-key: env-envkey-${{ github.sha }}-${{ github.run_attempt }} | |
| environment-file: environment.yml | |
| environment-name: xpsipy3 | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| - name: mamba installs | |
| run: | | |
| micromamba install flake8 pytest h5py "ultranest>=4.0" | |
| - name: Set up GCC | |
| run: | | |
| sudo apt-get install -y gcc | |
| shell: bash -l {0} | |
| - name: install gsl | |
| run: | | |
| sudo apt-get install -y libgsl-dev | |
| - name: Lint with flake8 | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| #- name: multinest and pymultinest install (seems working but the pytest below still cannot find the MultiNest library files) | |
| # run: | | |
| # sudo apt-get install cmake libblas-dev liblapack-dev libatlas-base-dev | |
| # sudo apt install mpich | |
| # git clone https://github.com/farhanferoz/MultiNest.git multinest | |
| # cd multinest/MultiNest_v3.12_CMake/multinest/ | |
| # mkdir build | |
| # cd build | |
| # CC=gcc FC=mpif90 CXX=g++ cmake -DCMAKE_{C,CXX}_FLAGS="-O3 -march=native -funroll-loops" -DCMAKE_Fortran_FLAGS="-O3 -march=native -funroll-loops" .. | |
| # make | |
| # cd ../../../../ | |
| # git clone https://github.com/JohannesBuchner/PyMultiNest.git pymultinest | |
| # cd pymultinest | |
| # python setup.py install | |
| # cd .. | |
| # export LD_LIBRARY_PATH=$(pwd)/multinest/MultiNest_v3.12_CMake/multinest/lib/:$LD_LIBRARY_PATH | |
| # echo $LD_LIBRARY_PATH | |
| - name: install X-PSI package | |
| run: | | |
| pip install . | |
| shell: bash -l {0} | |
| env: | |
| CC: gcc | |
| - name: Test with pytest | |
| run: | | |
| pytest |