diff --git a/.github/workflows/dependency-freshness.yml b/.github/workflows/dependency-freshness.yml new file mode 100644 index 0000000..452408c --- /dev/null +++ b/.github/workflows/dependency-freshness.yml @@ -0,0 +1,52 @@ +name: dependency freshness + +# Every dependency on its ecosystem's newest STABLE release, enforced on push +# as well as at commit time. This repo OWNS the gate, so unlike every other +# repo it runs its own copy directly instead of checking one out. +# +# Deliberately added last, after all eleven manifests here were brought +# current: installing the gate on a repo before its dependencies are upgraded +# makes it instantly and permanently red, which teaches people to ignore it. The local pre-commit hook only sees the manifests +# in a commit and can be skipped entirely by a fresh clone that never ran +# `pre-commit install`; this runs `--all` over the whole repo. +# +# `--strict` is CI-only. Offline the gate degrades to its cached answer and +# passes, because `--no-verify` is banned locally and a hook that hard-failed +# on a flaky connection would leave no way to commit. A runner is always +# online, so here an undeterminable answer is a real failure. +# +# Expect this to go red for reasons this repo's commit did not cause: an +# upstream release overnight is enough. That is the chosen behaviour -- the +# alternative is a gate that only notices staleness when someone remembers to +# look. + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + dependency-freshness: + name: dependencies on newest stable + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Install the gate's two runtime dependencies + run: python -m pip install --upgrade pyyaml packaging + + - name: Cache registry lookups + uses: actions/cache@v4 + with: + path: ~/.cache/dep-freshness + key: dep-freshness-${{ hashFiles('**/pubspec.yaml', '**/package.json', '**/requirements*.txt', '**/pyproject.toml') }} + restore-keys: dep-freshness- + + - name: Every dependency is on newest stable + run: bash scripts/check_dependency_freshness.sh --all --strict