Skip to content

Bump astral-sh/setup-uv from 7.1.6 to 7.2.0 #1592

Bump astral-sh/setup-uv from 7.1.6 to 7.2.0

Bump astral-sh/setup-uv from 7.1.6 to 7.2.0 #1592

Workflow file for this run

name: CI jobs
on:
# run on pushes to the default branch
push:
branches: [main]
# run on pull requests originated from forks based on the `main` branch.
# note that if you're trying to edit the CI in a pull request,
# your changes won't run here. you need to temporarily add your branch to
# the `branches` list above.
pull_request:
branches: [main]
# run on releases
release:
types: ["published"]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
Authorize:
environment: ${{ github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository &&
'external' || 'internal' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- run: true
Static-Check:
needs: Authorize
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
version: "0.7.12"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
architecture: "x64"
- run: uv pip install --system "hatch>=1.14.2"
- run: hatch run tests.py3.12-2.10:static-check
Run-Unit-Tests:
needs: Authorize
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
airflow-version:
["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "3.0"]
exclude:
- python-version: "3.11"
airflow-version: "2.4"
- python-version: "3.11"
airflow-version: "2.5"
- python-version: "3.11"
airflow-version: "2.6"
# Apache Airflow versions prior to 2.9.0 have not been tested with Python 3.12.
# Official support for Python 3.12 and the corresponding constraints.txt are available only for Apache Airflow >= 2.9.0.
# See: https://github.com/apache/airflow/tree/2.9.0?tab=readme-ov-file#requirements
# See: https://github.com/apache/airflow/tree/2.8.4?tab=readme-ov-file#requirements
- python-version: "3.12"
airflow-version: "2.4"
- python-version: "3.12"
airflow-version: "2.5"
- python-version: "3.12"
airflow-version: "2.6"
- python-version: "3.12"
airflow-version: "2.7"
- python-version: "3.12"
airflow-version: "2.8"
steps:
- uses: actions/checkout@v6.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
persist-credentials: false
- uses: actions/cache@v5
with:
path: |
~/.cache/uv
~/.cache/pip
.local/share/hatch/
key: unit-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.airflow-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('dagfactory/__init__.py') }}
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
version: "0.7.12"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
run: |
uv pip install --system "hatch>=1.14.2"
hatch -e tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }} run pip freeze
- name: Test DAG Factory against Airflow ${{ matrix.airflow-version }} and Python ${{ matrix.python-version }}
run: |
hatch run tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }}:test-cov
- name: Upload coverage to Github
uses: actions/upload-artifact@v5
with:
name: coverage-unit-test-${{ matrix.python-version }}-${{ matrix.airflow-version }}
path: .coverage
include-hidden-files: true
Run-Integration-Tests:
needs: Authorize
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
airflow-version:
["2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "3.0"]
exclude:
- python-version: "3.11"
airflow-version: "2.4"
- python-version: "3.11"
airflow-version: "2.5"
- python-version: "3.11"
airflow-version: "2.6"
# Apache Airflow versions prior to 2.9.0 have not been tested with Python 3.12.
# Official support for Python 3.12 and the corresponding constraints.txt are available only for Apache Airflow >= 2.9.0.
# See: https://github.com/apache/airflow/tree/2.9.0?tab=readme-ov-file#requirements
# See: https://github.com/apache/airflow/tree/2.8.4?tab=readme-ov-file#requirements
- python-version: "3.12"
airflow-version: "2.4"
- python-version: "3.12"
airflow-version: "2.5"
- python-version: "3.12"
airflow-version: "2.6"
- python-version: "3.12"
airflow-version: "2.7"
- python-version: "3.12"
airflow-version: "2.8"
steps:
- uses: actions/checkout@v6.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
persist-credentials: false
- uses: actions/cache@v5
with:
path: |
~/.cache/uv
~/.cache/pip
.local/share/hatch/
key: integration-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.airflow-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('dagfactory/__init__.py') }}
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
version: "0.7.12"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
run: |
uv pip install --system "hatch>=1.14.2"
hatch -e tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }} run pip freeze
- name: Test DAG Factory against Airflow ${{ matrix.airflow-version }} and Python ${{ matrix.python-version }}
run: |
hatch run tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }}:test-integration-setup
hatch run tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }}:test-integration
env:
AIRFLOW__CORE__DAGBAG_IMPORT_TIMEOUT: 90.0
AIRFLOW_HOME: ${{ github.workspace }}
CONFIG_ROOT_DIR: ${{ github.workspace }}/dags
PYTHONPATH: ${{ github.workspace }}:${{ github.workspace }}/dev/dags:$PYTHONPATH
- name: Upload coverage to Github
uses: actions/upload-artifact@v5
with:
name: coverage-integration-test-${{ matrix.python-version }}-${{ matrix.airflow-version }}
path: .coverage
include-hidden-files: true
Code-Coverage:
if: github.event.action != 'labeled'
needs:
- Run-Unit-Tests
- Run-Integration-Tests
- Build-Mkdocs
- Authorize
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
version: "0.7.12"
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install coverage
run: |
uv tool install coverage
- name: Download all coverage artifacts
uses: actions/download-artifact@v7
with:
path: ./coverage
- name: Combine coverage
run: |
coverage combine ./coverage/coverage*/.coverage
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
Build-Mkdocs:
name: Build MkDocs
runs-on: ubuntu-latest
permissions:
contents: read
needs:
- Authorize
steps:
- uses: actions/checkout@v6.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
persist-credentials: true
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install hatch via uv
run: uv pip install --system "hatch>=1.14.2"
- name: Build docs (MkDocs)
run: hatch run docs:build
Deploy-Pages:
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release'
permissions:
contents: write
runs-on: ubuntu-latest
needs:
- Authorize
steps:
- uses: actions/checkout@v6.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
persist-credentials: true
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
version: "0.7.12"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
architecture: "x64"
- name: Install packages and dependencies
run: uv pip install --system "hatch>=1.14.2"
- name: Deploy Docs
run: |
git config user.name "oss-integrations-bot"
git config user.email "oss-integrations-bot@astronomer.io"
git fetch origin gh-pages --depth=1
if [[ $GITHUB_EVENT_NAME == "release" ]]; then
hatch run docs:gh-release
else
hatch run docs:gh-deploy
fi
Publish-Package:
if: github.event_name == 'release'
name: Build and publish Python 🐍 distributions 📦 to PyPI
needs:
- Static-Check
- Run-Unit-Tests
- Run-Integration-Tests
- Deploy-Pages
- Code-Coverage
- Authorize
- Build-Mkdocs
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dag-factory
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v6.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
version: "0.7.12"
- uses: actions/setup-python@v6
with:
python-version: "3.10"
architecture: "x64"
- name: Verify Git Tag and package version
run: python3 ./scripts/verify_tag_and_version.py
- run: uv build --wheel --sdist
- run: uv publish