# GitHub Actions credits: where the bleed comes from

Review of the five nf-core pipelines with the highest GitHub Actions minutes: `raredisease`, `riboseq`, `funcprofiler`, `ampliseq`, and `sarek`.

## Summary

The bleed is `nf-core/raredisease`'s nf-test workflow. It is the only one of the five still running its test matrix on GitHub-hosted runners (`ubuntu-latest`) instead of the nf-core self-hosted pool. Everything else in these repos is small by comparison. A PR moving raredisease's nf-test jobs to the self-hosted labels is already open.

## Main culprit: raredisease nf-test on hosted runners

- On `dev`, all three jobs (`nf-test-changes`, `nf-test`, `confirm-pass`) run on `ubuntu-latest`.
- The matrix (`max_shards: 25` x profiles `docker` + `singularity` x two `NXF_VER`) spins up between **28 and 156 GitHub-hosted jobs per run** (from the run timing records).
- Each shard pulls containers and runs a full nf-test suite on a hosted machine.
- Busy days logged 4-10 runs, and failed runs get re-run (`run_attempt` > 1), inflating the total further.

The result is thousands of hosted job-minutes per day, far beyond any other workflow in these repos.

### Secondary helper: `nf-test-cadd.yml`

raredisease's CADD test also runs hosted and pulls the ~20 GB CADD container. It is path-gated, so it is rare, but heavy when it runs. The same PR moves it to self-hosted.

## Small, cumulative auxiliaries (all from the nf-core template)

These run per PR or per run and are identical across the repos because they ship with the nf-core template. Raredisease only adds two custom workflows on top: `changelog.yml` (changelog enforcer) and `nf-test-cadd.yml` (above). The rest is template behaviour, so trimming it means changing the template, not any single pipeline.

- `pr-comment.yml`: triggers on every completed `workflow_run`, adding one hosted job per run. Cheap, but it roughly doubles the hosted run count.
- `linting.yml`: two hosted jobs per PR (`pre-commit` + `nf-core pipelines lint`).
- `branch.yml`, `template-version-comment.yml`, `fix_linting.yml`: small per-PR hosted jobs.
- `clean-up.yml`: weekly cron.
- `download_pipeline.yml`: runs on PRs to `main`/`master` and on manual dispatch. It is the only `free-disk-space` consumer left on hosted runners once the nf-test PR lands.
- `changelog.yml`: raredisease-only, one small per-PR job.

## Not cost drivers

- `awstest.yml` / `awsfulltest.yml`: the compute runs on Seqera Platform / AWS, not on GitHub. GitHub only orchestrates, and awsfulltest needs two approvals and a PR target of `main`/`master`.
- `release-announcements.yml`: release-only.

## The other four repos

`riboseq`, `funcprofiler`, `ampliseq`, and `sarek` already run nf-test on the self-hosted pool, so their per-PR spend is limited to the auxiliary workflows above. None of them reach raredisease's scale.

## After the fix: one thing to keep watching

Even on self-hosted runners, raredisease's `max_shards: 25` (template default is 7) pushes 50-100 jobs through the shared self-hosted pool per sweep. That is not GitHub Actions-billed, but it is a load multiplier, so review it if the pool gets congested.