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
29 changes: 18 additions & 11 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ name: Regression Tests
on:
# Manual trigger
workflow_dispatch:
# Run weekly on Sundays
# Nightly, an hour after python-hatch-workflow.yml's full run. This is the
# run that measures the lane's coverage for Codecov; pushes to main skip it
# (see "Run regression tests" below).
schedule:
- cron: '0 8 * * 0'
- cron: '0 8 * * *'

# PRE-MERGE GATE. The required context is the `Regression gate` job at the end
# of this file, never the `regression` job itself.
Expand Down Expand Up @@ -207,12 +209,16 @@ jobs:
# tests and the few marked neither fast nor network.
- name: Run regression tests
run: |
# No coverage on pull requests: the Codecov upload below skips them, so
# it would be computed and thrown away (edgartools-07lk.26 step B).
if [ "${{ github.event_name }}" = "pull_request" ]; then
pytest -rs -m 'regression and not fast' --enable-cache
else
# Coverage only on the nightly and manual runs. It roughly doubles the
# lane: push runs on main took 25-37 min with it (November 2026) against
# 12-19 min for the same tests on a pull request without it, and a push
# run's job is to say quickly whether main is red. Codecov carries the
# `regression` flag forward between nightly uploads (codecov.yml), so
# commits in between keep this lane's lines in their total.
if [ "${{ github.event_name }}" = "schedule" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
pytest -rs --cov --cov-report=xml -m 'regression and not fast' --enable-cache
else
pytest -rs -m 'regression and not fast' --enable-cache
fi

# `always()`: a run that failed still warmed the cache, and the next one
Expand All @@ -224,12 +230,13 @@ jobs:
path: ${{ github.workspace }}/.edgar-data/_tcache
key: edgar-tcache-regression-${{ github.run_id }}

# Not on pull requests. Codecov posts its own commit statuses, and a partial
# `regression`-flag upload from an advisory lane would put a red check on a
# pull request that this workflow is explicitly not allowed to influence.
# Only from the runs that measured coverage: the nightly and manual ones.
# Never on pull requests: Codecov posts its own commit statuses, and a
# partial `regression`-flag upload would put a red check on a pull request
# that only the `Regression gate` job may decide.
- name: Upload coverage reports
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
if: matrix.python-version == '3.12' && github.event_name != 'pull_request'
if: matrix.python-version == '3.12' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
with:
files: coverage.xml
fail_ci_if_error: false
Expand Down
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Codecov settings. Anything not set here keeps Codecov's defaults.
#
# The regression lane (.github/workflows/regression-tests.yml) uploads coverage
# under the `regression` flag only from its nightly and manual runs; pushes to
# main skip coverage to finish in half the time. Carryforward reuses the last
# `regression` upload for commits that have none, so their totals do not dip
# by this lane's lines between nightly runs.
flag_management:
individual_flags:
- name: regression
carryforward: true
Loading