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
20 changes: 8 additions & 12 deletions .github/workflows/CDA-testing.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: CI
name: CDA integration

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '17 8 * * *'
workflow_dispatch:

jobs:
Expand All @@ -18,7 +16,7 @@ jobs:
fail-fast: false
max-parallel: 6
matrix:
python-version: ['3.9', '3.13']
python-version: ['3.9', '3.x']
# Keep the release pins in sync with the environments (see CONTRIBUTING.md).
cda:
- name: latest
Expand Down Expand Up @@ -78,16 +76,14 @@ jobs:
key: ${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-poetry-${{
hashFiles('poetry.lock') }}

# Install dependencies only if cache is missed
- name: Install dependencies
if: steps.cache-poetry-venv.outputs.cache-hit != 'true'
env:
POETRY_INSTALLER_ONLY_BINARY: ':all:'
run: poetry install --no-root

# Run pytest and generate coverage report data.
- name: Run Tests and Check Types
run: |
poetry run pytest tests/cda/ --doctest-modules --cov --cov-report=xml:out/coverage.xml
poetry run mypy --strict cwms/
- name: Run Tests
run: poetry run pytest tests/cda/ --doctest-modules --cov --cov-report=xml:out/coverage.xml

- name: Generate Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
name: Code Check

# Run the workflow on all branches.
on: [push, pull_request]
on:
pull_request:
push:
branches: [main]

concurrency:
group: code-check-${{ github.event_name }}-${{ github.event.pull_request.number
|| github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
# Run basic code quality checks.
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 0 * * 0'

concurrency:
group: codeql-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref
}}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
analyze:
name: Analyze
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Set Up Python
uses: actions/setup-python@v7
with:
python-version: '3.13'
python-version: '3.x'
- name: Install Poetry
uses: abatilo/actions-poetry@v4
- name: Install Dependencies
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
name: Testing

# Run the workflow on all branches.
on: [push, pull_request]
on:
pull_request:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: testing-${{ github.event_name }}-${{ github.event.pull_request.number ||
github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
# Run tests and generate code coverage report.
Expand All @@ -11,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.13', '3.14']
python-version: ['3.9', '3.x']

steps:
- uses: actions/checkout@v7
Expand Down
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,40 @@ subject before merging; Release Please reads commits on `main`, not PR titles
directly. With other merge methods, preserve Conventional Commit messages in the
merged commits.

### CI coverage

Unit tests and strict type checks run on Python **3.9** and **latest stable**
(`3.x`) for PRs targeting any branch and pushes to `main`. Formatting and CodeQL
also run on PRs and main. Feature-branch pushes do not start duplicate checks;
new PR commits cancel superseded runs. Draft and documentation-only PRs use the
same straightforward checks as other PRs.

The **CDA integration** workflow runs the full 18-job matrix nightly at 08:17 UTC:
two Python versions, three CDA versions, and three schema versions. It does not
run automatically on PRs or merges. Integration failures can therefore surface
after merge.

**Before approving a PR that could affect CDA integration**, run the full matrix
against the PR's head branch and review the results. You can also run it anytime
you want to check a branch. From this repository, use:

```sh
gh workflow run CDA-testing.yml --ref <branch>
```

Replace `<branch>` with the branch name on GitHub. Alternatively, use **Actions >
CDA integration > Run workflow** and select the branch. Starting the workflow
does not mean the tests passed; check the completed run in Actions before approving.
Inspect failed combinations and backend logs, reproduce using the Compose
overrides above, and fix the cause rather than dropping failing combinations.

Release publishing still tests the exact tag on latest stable Python, verifies
the package version, and builds before publishing. CodeQL retains its weekly run.
Repository administrators should require the two unit-test checks, formatting,
and CodeQL (plus existing external requirements). Nightly CDA checks must not be
required on PRs because they do not run there. These workflow changes do not
modify repository merge rules.

### Release flow

1. Merge reviewed changes into `main`.
Expand Down
Loading