Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 61 additions & 39 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,92 +7,114 @@ on:
tags:
- "*"
pull_request:
workflow_call:

env:
UV_FROZEN: "1"
UV_MANAGED_PYTHON: "1"

jobs:
build_and_test:
formatting:
uses: lsst/rubin_workflows/.github/workflows/formatting.yaml@main

pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"

- name: Run prek
uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0
with:
extra-args: --all-files

test-matrix:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13", "3.14"]
htcondor-version: ["htcondor>=24.0,<24.1", "htcondor>=25.0,<25.1"]

steps:
- uses: actions/checkout@v7
- name: Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Need to clone everything to determine version from git.
# Need to clone everything to embed the version.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: "latest-known"
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Update pip/wheel infrastructure
run: |
pip install --upgrade pip
pip install uv

- name: Install dependencies
run: |
uv pip install --system --upgrade setuptools wheel
uv pip install --system -r requirements.txt

# We have two cores so we can speed up the testing with xdist
- name: Install pytest packages
run: |
uv pip install --system pytest pytest-xdist pytest-cov
uv sync --all-packages --all-extras

- name: List installed packages
run: |
pip list -v
uv tree

- name: Build and install
run: |
uv pip install --system --no-deps -v -e .
- name: Run Test Matrix
run: >
uv run --with '${{ matrix.htcondor-version}}' --isolated
pytest -r a -v
--cov=python --cov=tests --cov-report=xml --cov-report=term --cov-branch
--junitxml=junit.xml -o junit_family=legacy

- name: Run tests
run: |
pytest -r a -v --cov=python --cov=tests --cov-report=xml --cov-report=term --cov-branch \
--junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to codecov
uses: codecov/codecov-action@v7
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f #v7.0.0
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f #v7.0.0
with:
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}

test:
needs: [formatting, pre-commit, test-matrix]

runs-on: ubuntu-latest
steps:
- name: Test Matrix Passed
run: echo "Testing Matrix has passed."

pypi:

runs-on: ubuntu-latest
needs: [build_and_test]
needs: [test]
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v7
- name: Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Need to clone everything to embed the version.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: "latest-known"
enable-cache: true
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel build

- name: Build and create distribution
run: |
python -m build --skip-dependency-check
run: uv build

- name: Upload
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
user: __token__
password: ${{ secrets.PYPI_UPLOADS }}
33 changes: 13 additions & 20 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,30 @@ on:
- main
pull_request:

env:
UV_FROZEN: "1"

jobs:
build_sphinx_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Need to clone everything for the git tags.
# Need to clone everything to embed the version.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v7
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
python-version: '3.13'
cache: "pip"
cache-dependency-path: "setup.cfg"

- name: Update pip/wheel infrastructure
run: |
python -m pip install --upgrade pip
pip install wheel uv
version: "latest-known"
enable-cache: true
python-version: "3.13"

- name: Install dependencies
run: |
uv pip install --system -r requirements.txt

- name: Build and install
run: uv pip install --system --no-deps -v .

- name: Install documenteer
run: uv pip install --system -r doc/requirements.txt
uv sync --all-packages --all-extras

- name: Build documentation
working-directory: ./doc
run: package-docs build -n -W
run: uv run package-docs build -n -W
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4.37.8
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4.37.8
uses: github/codeql-action/autobuild@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 #v4.38.2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -71,4 +71,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4.37.8
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
18 changes: 10 additions & 8 deletions .github/workflows/do_not_merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- name: Check that there are no commits that should not be merged
uses: gsactions/commit-message-checker@v2
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee # v2.0.0
with:
excludeDescription: "true" # optional: this excludes the description body of a pull request
excludeTitle: "true" # optional: this excludes the title of a pull request
Expand All @@ -26,16 +26,18 @@ jobs:
'DO NOT MERGE'. Remove this commit from the branch before merging
or change the commit summary."

- uses: actions/checkout@v7
- name: Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Check requirements.txt for branches
- name: Check lockfiles for branches
shell: bash
run: |
FILE=requirements.txt
MATCH=tickets/DM-
if grep -q $MATCH $FILE
FILES=(pyproject.toml uv.lock)
# The slash can be URI-encoded in uv lock files.
MATCH="tickets(/|%2F)DM"
if grep -q -E "$MATCH" "${FILES[@]}"
then
echo "Ticket branches found in $FILE:"
grep -n $MATCH $FILE
echo "Ticket branches found in ${FILES[*]}:"
grep -n -E "$MATCH" "${FILES[@]}"
exit 1
fi
13 changes: 0 additions & 13 deletions .github/workflows/docstyle.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/formatting.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/pre-commit.yaml

This file was deleted.

Loading
Loading