Skip to content

Merge pull request #364 from lsst/tickets/OPSIM-1079 #2

Merge pull request #364 from lsst/tickets/OPSIM-1079

Merge pull request #364 from lsst/tickets/OPSIM-1079 #2

Workflow file for this run

name: Build and Publish PyPI
on:
push:
branches:
- main
tags:
- "*"
jobs:
tests:
name: Check Tests (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- 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: install rubin_sim
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: |
pytest -r a -v --cov=rubin_sim --cov=tests --cov-report=xml --cov-report=term --cov-branch
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
file: coverage.xml
pypi:
name: Build and upload to PyPI
runs-on: ubuntu-latest
needs: [tests]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
# Need to clone everything to embed the version.
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip"
- name: Install dependencies for build
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools build
- name: Build and create distribution
run: |
python -m build --skip-dependency-check
- name: Upload to lsst-sp PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.SP_PYPI_UPLOADS }}