33# The template responsible for it is in
44# scripts/split_tox_gh_actions/templates/base.jinja
55name : Test AI Workflow
6+ # Reusable workflow. It is invoked by the top-level `test.yml` orchestrator.
67on :
7- push :
8- branches :
9- - master
10- - release/**
11- - major/**
12- pull_request :
13- # Cancel in progress workflows on pull_requests.
14- # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
15- concurrency :
16- group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17- cancel-in-progress : true
8+ workflow_call :
189permissions :
1910 contents : read
2011 actions : read
21- pull-requests : write
22- statuses : write
2312jobs :
2413 test-ai_workflow :
2514 name : AI Workflow
3928 - name : Install uv
4029 uses : astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
4130 with :
42- cache-suffix : ${{ github.workflow }}-${{ matrix.python-version }}
31+ cache-suffix : ai_workflow-${{ matrix.python-version }}
32+ enable-cache : ${{ matrix.python-version != '3.6' && matrix.python-version != '3.7' }}
4333 - name : Mark workspace safe for git (3.6/3.7 container)
4434 # needed to make git rev-parse work in the containers
4535 # subprocesses (e.g. sentry_sdk.utils.get_git_revision) can run git.
4838 - name : Setup Test Env
4939 run : |
5040 uv sync
51- - name : Erase coverage
52- run : |
53- uv run coverage erase
5441 - name : Test langchain-base
5542 run : |
5643 set -x # print commands that are executed
@@ -63,28 +50,17 @@ jobs:
6350 run : |
6451 set -x # print commands that are executed
6552 ./scripts/runtox.sh "py${{ matrix.python-version }}-langgraph"
66- - name : Generate coverage XML
67- if : ${{ !cancelled() }}
68- run : |
69- uv run coverage combine .coverage-sentry-*
70- uv run coverage xml
71- - name : Parse and Upload Coverage
53+ - name : Upload coverage data
7254 if : ${{ !cancelled() }}
73- uses : getsentry/codecov-action@d90e69cdf071dfbb0430159125321dc09c424d4c # main
55+ continue-on-error : true
56+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
7457 with :
75- token : ${{ secrets.GITHUB_TOKEN }}
76- files : coverage.xml
77- junit-xml-pattern : .junitxml
78- base-branch : master
79- verbose : true
80- check_required_tests :
81- name : All AI Workflow tests passed
82- needs : test-ai_workflow
83- # Always run this, even if a dependent job failed
84- if : always()
85- runs-on : ubuntu-22.04
86- steps :
87- - name : Check for failures
88- if : needs.test-ai_workflow.result != 'success'
89- run : |
90- echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
58+ name : coverage-ai_workflow-${{ matrix.python-version }}
59+ # .coverage-* / .junitxml-* are dotfiles, excluded by default
60+ include-hidden-files : true
61+ path : |
62+ .coverage-sentry-*
63+ .junitxml-*
64+ if-no-files-found : ' ignore'
65+ retention-days : 1
66+ overwrite : true
0 commit comments