Merge pull request #177 from LSSTDESC/test_ccdgains #598
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: build_and_test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - lsst-dev | |
| - master | |
| pull_request: | |
| jobs: | |
| build_and_test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup micromamba | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| micromamba-version: 'latest' | |
| environment-name: test | |
| create-args: >- | |
| python=3.11 | |
| channels: conda-forge,defaults | |
| cache-environment: true | |
| cache-downloads: true | |
| - name: Install system dependencies | |
| shell: micromamba-shell {0} | |
| run: | | |
| micromamba install -y astrometry rubin-libradtran -c conda-forge | |
| - name: Install Spectractor with dependencies | |
| shell: micromamba-shell {0} | |
| run: | | |
| pip install -v -e ".[dev]" | |
| pip install git+https://github.com/LSSTDESC/getObsAtmo.git@main | |
| - name: Download test data | |
| shell: micromamba-shell {0} | |
| run: | | |
| wget -r -q -nc http://data.astrometry.net/5000/index-5002-24.fits | |
| wget -r -q -nc http://data.astrometry.net/5000/index-5000-40.fits | |
| mkdir -p $MAMBA_ROOT_PREFIX/envs/test/data/ | |
| mv data.astrometry.net/5000/index-*.fits $MAMBA_ROOT_PREFIX/envs/test/data/ | |
| export ASTROMETRYNET_DIR=$MAMBA_ROOT_PREFIX/envs/test | |
| - name: List installed packages | |
| shell: micromamba-shell {0} | |
| run: | | |
| micromamba list | |
| pip list -v | |
| - name: Run full chain test | |
| shell: micromamba-shell {0} | |
| run: | | |
| pytest tests/test_fullchain.py --log-cli-level=INFO -v -rs --cov --cov-report lcov | |
| - name: Run pytests | |
| shell: micromamba-shell {0} | |
| run: | | |
| pytest tests/test_extractor.py --log-cli-level=INFO --cov --cov-append --cov-report lcov | |
| pytest tests/test_simulator.py --log-cli-level=INFO --cov --cov-append --cov-report lcov | |
| pytest tests/test_utils.py --log-cli-level=INFO --cov --cov-append --cov-report lcov | |
| pytest tests/test_fitter.py --log-cli-level=INFO --cov --cov-append --cov-report lcov | |
| pytest tests/test_multispectra.py --log-cli-level=INFO --cov --cov-append --cov-report lcov | |
| - name: Run doctests and coverage | |
| shell: micromamba-shell {0} | |
| run: | | |
| pytest spectractor \ | |
| --ignore=spectractor/astrometry.py \ | |
| --ignore=spectractor/parameters.py \ | |
| --ignore=spectractor/fit/mcmc.py \ | |
| -v --cov --cov-append --cov-report lcov \ | |
| --doctest-modules \ | |
| --doctest-continue-on-failure | |
| continue-on-error: true | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@master | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| path-to-lcov: coverage.lcov |