langflow/.github/workflows/store_pytest_durations.yml
dependabot[bot] cee3d2a9ea
build(deps):(deps): bump astral-sh/setup-uv from 4 to 5 (#6060)
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 4 to 5.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/v4...v5)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-02-03 15:25:29 +00:00

88 lines
2.8 KiB
YAML

name: Store pytest durations
on:
workflow_dispatch:
schedule:
# Run job at 6:30 UTC every Monday (10.30pm PST/11.30pm PDT Sunday night)
- cron: "30 6 * * 1"
env:
PYTEST_RUN_PATH: "src/backend/tests"
jobs:
build:
name: Run pytest and store durations
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
UV_CACHE_DIR: /tmp/.uv-cache
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install the project
run: uv sync --dev
- name: Run unit tests
id: run_tests
continue-on-error: true
run: uv run pytest src/backend/tests/unit --durations-path src/backend/tests/.test_durations --splitting-algorithm least_duration --store-durations
- name: Minimize uv cache
run: uv cache prune --ci
- name: Close existing PRs
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open'
});
for (const pull of pulls) {
if (pull.title === "chore: update test durations") {
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pull.number,
state: 'closed'
});
}
}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch-token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: update test durations"
title: "chore: update test durations"
body: |
Automated PR to update test durations file.
This PR was automatically created by the store_pytest_durations workflow.
branch: update-test-durations
branch-suffix: timestamp
delete-branch: true
maintainer-can-modify: true