Skip to content

OPSIM-1093: feature. Migration from rubin_sim. #36

OPSIM-1093: feature. Migration from rubin_sim.

OPSIM-1093: feature. Migration from rubin_sim. #36

Workflow file for this run

name: Run Tests and Build Documentation
on:
# Trigger the workflow on push (to main) or pull request
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
Tests:
name: Run Tests (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
miniforge-variant: Mambaforge
use-mamba: true
channel-priority: strict
show-channel-urls: true
- name: configure conda and install requirements
shell: bash -l {0}
run: |
mamba config --set always_yes yes
mamba install --quiet --file=requirements.txt
mamba install --quiet --file=test-requirements.txt
- name: install rubin_scheduler
shell: bash -l {0}
run: |
echo `pwd`
ls ${{ github.workspace }}
python -m pip install .
- name: download rubin_sim_data components needed for unit tests
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir
scheduler_download_data --tdqm_disable -d 'site_models,scheduler,skybrightness_pre,utils'
- name: conda list
shell: bash -l {0}
run: conda list
- name: run tests
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir
pytest -r a -v
Docs:
name: Build and upload documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.11"
channels: conda-forge
channel-priority: strict
show-channel-urls: true
- name: configure and install requirements and documenteer
shell: bash -l {0}
run: |
conda config --set always_yes yes
conda install --quiet --file=requirements.txt
conda install --quiet pip
pip install "documenteer[guide]"
- name: install rubin_scheduler
shell: bash -l {0}
run: |
echo `pwd`
ls ${{ github.workspace }}
python -m pip install .
- name: download rubin_sim_data components needed to set up metrics for metricList
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}
scheduler_download_data --tdqm_disable -d 'scheduler'
- name: check conda and documenteer
shell: bash -l {0}
run: |
conda list
- name: build docs
shell: bash -l {0}
run: |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}
cd docs
package-docs build
- name: upload documentation
uses: lsst-sqre/ltd-upload@v1
with:
project: "rubin-scheduler"
dir: "docs/_build/html"
username: ${{ secrets.ltd_username }}
password: ${{ secrets.ltd_password }}