Update GitHub Actions #332
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: Python CI | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # full depth for setuptools_scm | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- 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 }} | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # full depth for setuptools_scm | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Run tox | |
uses: lsst-sqre/run-tox@v1 | |
with: | |
python-version: ${{ matrix.python }} | |
tox-envs: "docs" | |
- name: Upload documentation | |
uses: lsst-sqre/ltd-upload@v1 | |
if: ${{ github.event_name == 'push' }} | |
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@v4 | |
with: | |
fetch-depth: 0 # full depth for setuptools_scm | |
- name: Build and publish | |
uses: lsst-sqre/build-and-publish-to-pypi@v2 | |
with: | |
python-version: "3.11" |