Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
27 changes: 0 additions & 27 deletions .github/workflows/_check.yml

This file was deleted.

11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ name: CI

on:
push:
branches:
- main
pull_request:

jobs:
check:
uses: ./.github/workflows/_check.yml

lint:
needs: check
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_tox.yml
with:
tox: pre-commit

test:
needs: check
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_test.yml
with:
python-version: dev
Expand All @@ -26,8 +21,6 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

docs:
needs: check
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_docs.yml
permissions:
contents: write
Expand Down
24 changes: 24 additions & 0 deletions docs/explanations/decisions/0021-ci-only-pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 21. Run CI on pull requests and main branch only

Date: 2025-05-06

## Status

Accepted

## Context

CI has been being run on branches that do not have open pull requests, which has: added spurious jobs to the organisation's compute limit; made workflow definitions more complex; made the results page harder to parse; and allowed known working development branches to become stale or forgotten.

Running CI only on branches that have open pull requests will: reduce compute jobs created for code that is known to not be working; simplify workflow definitions; simplify the CI results page; encourage early creation of pull requests, adding visibility to development.

Draft pull requests will still have CI jobs run, ensuring that code quality is maintained while allowing reviewers to ignore changes that are not ready for human review.

## Decision

CI will only be run on all PRs when changes are made, and on the main branch when PRs are merged into it: not on branches that do not have open PRs.
Opening a draft PR will allow CI to be run, with the understanding that the PR may not be ready for review.

## Consequences

The `check` job will be removed and CI will run on all PRs and on the `main` branch.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ on:
pull_request:

jobs:
check:
uses: ./.github/workflows/_check.yml

lint:
needs: check
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_tox.yml
with:
tox: pre-commit,type-checking
{% raw %}
test:
needs: check
if: needs.check.outputs.branch-pr == ''
strategy:
matrix:
runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
Expand All @@ -35,21 +29,15 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
{% endraw %}{% if docker %}
container:
needs: check
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_container.yml
permissions:
contents: read
packages: write
{% endif %}{% if sphinx %}
docs:
needs: check
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_docs.yml
{% endif %}
dist:
needs: check
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_dist.yml
{% if pypi %}
pypi:
Expand Down