Tickets/preops 3763 #79
Workflow file for this run
This file contains 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: Run Unit Tests | |
on: | |
# Trigger the workflow on pull request to main, or by hand | |
# 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@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
auto-update-conda: true | |
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: download rubin_sim_data components needed for unit tests | |
shell: bash -l {0} | |
run: | | |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir | |
mkdir $RUBIN_SIM_DATA_DIR | |
cd $RUBIN_SIM_DATA_DIR | |
wget -q https://s3df.slac.stanford.edu/data/rubin/sim-data/rubin_sim_data/tests_2022_10_18.tgz | |
tar -xf tests_2022_10_18.tgz | |
echo "tests_2022_10_18.tgz complete" | |
wget -q https://s3df.slac.stanford.edu/data/rubin/sim-data/rubin_sim_data/throughputs_2023_09_07.tgz | |
tar -xf throughputs_2023_09_07.tgz | |
echo "throughputs_2023_09_07.tgz complete" | |
wget -q https://s3df.slac.stanford.edu/data/rubin/sim-data/rubin_sim_data/site_models_2023_03_28.tgz | |
tar -xf site_models_2023_03_28.tgz | |
echo "site_models_2023_03_28.tgz complete" | |
wget -q https://s3df.slac.stanford.edu/data/rubin/sim-data/rubin_sim_data/scheduler_2023_09_22.tgz | |
tar -xf scheduler_2023_09_22.tgz | |
echo "scheduler_2023_09_22.tgz complete" | |
wget -q https://s3df.slac.stanford.edu/data/rubin/sim-data/rubin_sim_data/skybrightness_pre_2023_09_19.tgz | |
tar -xf skybrightness_pre_2023_09_19.tgz | |
echo "skybrightness_pre_2023_09_19.tgz complete" | |
- name: install schedview | |
shell: bash -l {0} | |
run: | | |
echo `pwd` | |
python -m pip install . | |
- name: conda list | |
shell: bash -l {0} | |
run: conda list | |
- name: run unit tests | |
shell: bash -l {0} | |
run: | | |
export RUBIN_SIM_DATA_DIR=${{ github.workspace }}/data_dir | |
pytest -r a -v --cov=schedview --cov=tests --cov-report=xml --cov-report=term --cov-branch | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
file: coverage.xml |