Skip to content

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
Update all actions and adopt our custom composite actions for running
tox, uploading to lsst.io, and publishing to PyPI.
  • Loading branch information
jonathansick committed Feb 22, 2024
1 parent 9622fbd commit 115155c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 50 deletions.
67 changes: 29 additions & 38 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,81 +16,72 @@ jobs:
- "3.12"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full depth for setuptools_scm

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install tox
run: pip install tox

- name: Run tox
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python }}
tox-envs: "lint,typing,py"
env:
LTD_TEST_AWS_ID: ${{ secrets.LTD_TEST_AWS_ID }}
LTD_TEST_AWS_SECRET: ${{ secrets.LTD_TEST_AWS_SECRET }}
LTD_TEST_BUCKET: ${{ secrets.LTD_TEST_BUCKET }}
run: tox -e py,lint,typing # run tox using Python in path

docs:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full depth for setuptools_scm

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install tox and
run: |
pip install tox
- name: Run tox
run: tox -e docs

- name: Install LTD Conveyor for upload
run: pip install .
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python }}
tox-envs: "docs"

- name: Upload to LSST the Docs
- name: Upload documentation
uses: lsst-sqre/ltd-upload@v1
if: ${{ github.event_name == 'push' }}
env:
LTD_USERNAME: ${{ secrets.LTD_USERNAME }}
LTD_PASSWORD: ${{ secrets.LTD_PASSWORD }}
run: ltd upload --product ltd-conveyor --gh --dir docs/_build/html
with:
project: "ltd-conveyor"
dir: "docs/_build/html"
username: ${{ secrets.ltd_username }}
password: ${{ secrets.ltd_password }}

pypi:

name: Upload release to PyPI
runs-on: ubuntu-latest
needs: [test, docs]
if: startsWith(github.ref, 'refs/tags/')
environment:
name: pypi
url: https://pypi.org/p/ltd-conveyor
permissions:
id-token: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full depth for setuptools_scm

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_SQRE_ADMIN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
uses: lsst-sqre/build-and-publish-to-pypi@v2
with:
python-version: "3.11"
23 changes: 11 additions & 12 deletions .github/workflows/cron-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ jobs:
- "3.12"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full depth for setuptools_scm

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install tox
run: pip install tox

- name: Run tox
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python }}
tox-envs: "lint,typing,py"
env:
LTD_TEST_AWS_ID: ${{ secrets.LTD_TEST_AWS_ID }}
LTD_TEST_AWS_SECRET: ${{ secrets.LTD_TEST_AWS_SECRET }}
LTD_TEST_BUCKET: ${{ secrets.LTD_TEST_BUCKET }}
run: tox -e py,lint,typing # run tox using Python in path

docs:

Expand All @@ -50,13 +50,12 @@ jobs:
fetch-depth: 0 # full depth for setuptools_scm

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install tox and LTD Conveyor
run: |
pip install tox
- name: Run tox
run: tox -e docs
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python }}
tox-envs: "docs"

0 comments on commit 115155c

Please sign in to comment.