Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Merge pull request #282 from lsst-sqre/u/neophile #738

Merge pull request #282 from lsst-sqre/u/neophile

Merge pull request #282 from lsst-sqre/u/neophile #738

Workflow file for this run

name: CI
"on":
merge_group: {}
pull_request: {}
push:
branches-ignore:
# These should always correspond to pull requests, so ignore them for
# the push trigger and let them be triggered by the pull_request
# trigger, avoiding running the workflow twice. This is a minor
# optimization so there's no need to ensure this is comprehensive.
- "dependabot/**"
- "gh-readonly-queue/**"
- "renovate/**"
- "tickets/**"
- "u/**"
release:
types: [published]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: pre-commit/[email protected]
test:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python:
- "3.11"
steps:
- uses: actions/checkout@v4
- uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python }}
tox-envs: "py,coverage-report,typing"
docs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
# Ensure the documentation gets the right version.
fetch-depth: 0
- name: Update package lists
run: sudo apt-get update
- name: Install extra packages
run: sudo apt install -y graphviz
- uses: lsst-sqre/run-tox@v1
with:
python-version: "3.11"
tox-envs: "docs"
cache-key-prefix: "docs"
# Only attempt documentation uploads for long-lived branches, tagged
# releases, and pull requests from ticket branches. This avoids version
# clutter in the docs and failures when a PR doesn't have access to
# secrets.
- uses: lsst-sqre/ltd-upload@v1
with:
project: neophile
dir: "docs/_build/html"
username: ${{ secrets.LTD_USERNAME }}
password: ${{ secrets.LTD_PASSWORD }}
if: >
github.event_name != 'merge_group'
&& (github.event_name != 'pull_request'
|| startsWith(github.head_ref, 'tickets/'))
test-packaging:
name: Test packaging
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for setuptools_scm
- name: Build and publish
uses: lsst-sqre/build-and-publish-to-pypi@v2
with:
python-version: "3.11"
upload: false
pypi:
name: Upload release to PyPI
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [lint, test, docs, test-packaging]
environment:
name: pypi
url: https://pypi.org/p/neophile
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for setuptools_scm
- uses: lsst-sqre/build-and-publish-to-pypi@v2
with:
python-version: "3.11"