Check that all jobs are in all-tests-passed.needs (#432)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Release Drafter / ✏️ Draft release (push) Has been cancelled
test / lint (push) Has been cancelled
test / test-default-version (macos-14) (push) Has been cancelled
test / test-default-version (macos-latest) (push) Has been cancelled
test / test-default-version (ubuntu-latest) (push) Has been cancelled
test / test-default-version (windows-latest) (push) Has been cancelled
test / test-specific-version (0.3) (push) Has been cancelled
test / test-specific-version (0.3.0) (push) Has been cancelled
test / test-specific-version (0.3.2) (push) Has been cancelled
test / test-specific-version (0.3.x) (push) Has been cancelled
test / test-specific-version (>=0.3.0) (push) Has been cancelled
test / test-semver-range (selfhosted-ubuntu-arm64) (push) Has been cancelled
test / test-semver-range (ubuntu-latest) (push) Has been cancelled
test / test-pep440-version (push) Has been cancelled
test / test-pyproject-file-version (push) Has been cancelled
test / test-malformed-pyproject-file-fallback (push) Has been cancelled
test / test-uv-file-version (push) Has been cancelled
test / test-checksum (map[checksum:4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd os:ubuntu-latest]) (push) Has been cancelled
test / test-checksum (map[checksum:a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218 os:macos-latest]) (push) Has been cancelled
test / test-with-explicit-token (push) Has been cancelled
test / test-uvx (push) Has been cancelled
test / test-tool-install (macos-14) (push) Has been cancelled
test / test-tool-install (macos-latest) (push) Has been cancelled
test / test-tool-install (ubuntu-latest) (push) Has been cancelled
test / test-tool-install (windows-latest) (push) Has been cancelled
test / test-tilde-expansion-tool-dirs (push) Has been cancelled
test / test-python-version (macos-latest) (push) Has been cancelled
test / test-python-version (ubuntu-latest) (push) Has been cancelled
test / test-python-version (windows-latest) (push) Has been cancelled
test / test-activate-environment (macos-latest) (push) Has been cancelled
test / test-activate-environment (ubuntu-latest) (push) Has been cancelled
test / test-activate-environment (windows-latest) (push) Has been cancelled
test / test-musl (push) Has been cancelled
test / test-setup-cache (auto, selfhosted-ubuntu-arm64) (push) Has been cancelled
test / test-setup-cache (auto, ubuntu-latest) (push) Has been cancelled
test / test-setup-cache (auto, windows-latest) (push) Has been cancelled
test / test-setup-cache (false, selfhosted-ubuntu-arm64) (push) Has been cancelled
test / test-setup-cache (false, ubuntu-latest) (push) Has been cancelled
test / test-setup-cache (false, windows-latest) (push) Has been cancelled
test / test-setup-cache (true, selfhosted-ubuntu-arm64) (push) Has been cancelled
test / test-setup-cache (true, ubuntu-latest) (push) Has been cancelled
test / test-setup-cache (true, windows-latest) (push) Has been cancelled
test / test-setup-cache-requirements-txt (push) Has been cancelled
test / test-setup-cache-dependency-glob (push) Has been cancelled
test / test-cache-local (map[expected-cache-dir:/home/runner/work/_temp/setup-uv-cache os:ubuntu-latest]) (push) Has been cancelled
test / test-cache-local (map[expected-cache-dir:/home/ubuntu/.cache/uv os:selfhosted-ubuntu-arm64]) (push) Has been cancelled
test / test-cache-local (map[expected-cache-dir:D:\a\_temp\setup-uv-cache os:windows-latest]) (push) Has been cancelled
test / test-setup-cache-local (push) Has been cancelled
test / test-tilde-expansion-cache-local-path (push) Has been cancelled
test / test-tilde-expansion-cache-dependency-glob (push) Has been cancelled
test / test-no-python-version (push) Has been cancelled
test / test-restore-cache (auto, selfhosted-ubuntu-arm64) (push) Has been cancelled
test / test-restore-cache (auto, ubuntu-latest) (push) Has been cancelled
test / test-restore-cache (auto, windows-latest) (push) Has been cancelled
test / test-restore-cache (false, selfhosted-ubuntu-arm64) (push) Has been cancelled
test / test-restore-cache (false, ubuntu-latest) (push) Has been cancelled
test / test-restore-cache (false, windows-latest) (push) Has been cancelled
test / test-restore-cache (true, selfhosted-ubuntu-arm64) (push) Has been cancelled
test / test-restore-cache (true, ubuntu-latest) (push) Has been cancelled
test / test-restore-cache (true, windows-latest) (push) Has been cancelled
test / test-restore-cache-requirements-txt (push) Has been cancelled
test / test-restore-cache-dependency-glob (push) Has been cancelled
test / test-restore-cache-local (push) Has been cancelled
test / cleanup-tilde-expansion-tests (push) Has been cancelled
test / all-tests-passed (push) Has been cancelled

This commit is contained in:
Kevin Stillhammer 2025-05-27 18:25:00 +02:00 committed by GitHub
parent f3121ef80e
commit c19c1b1ffd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,35 @@
import * as fs from "node:fs";
import * as yaml from "js-yaml";
interface WorkflowJob {
needs?: string[];
[key: string]: unknown;
}
interface Workflow {
jobs: Record<string, WorkflowJob>;
[key: string]: unknown;
}
const workflow = yaml.load(
fs.readFileSync("../workflows/test.yml", "utf8"),
) as Workflow;
const jobs = Object.keys(workflow.jobs);
const allTestsPassed = workflow.jobs["all-tests-passed"];
const needs: string[] = allTestsPassed.needs || [];
const expectedNeeds = jobs.filter((j) => j !== "all-tests-passed");
const missing = expectedNeeds.filter((j) => !needs.includes(j));
if (missing.length > 0) {
console.error(
`Missing jobs in all-tests-passed needs: ${missing.join(", ")}`,
);
console.info(
"Please add the missing jobs to the needs section of all-tests-passed in test.yml.",
);
process.exit(1);
}
console.log(
"All jobs in test.yml are in the needs section of all-tests-passed.",
);

View file

@ -29,6 +29,11 @@ jobs:
npm install
- run: |
npm run all
- name: Check all jobs are in all-tests-passed.needs
run: |
tsc check-all-tests-passed-needs.ts
node check-all-tests-passed-needs.js
working-directory: .github/scripts
- name: Make sure no changes from linters are detected
run: |
git diff --exit-code || (echo "::error::Please run 'npm run all' to fix the issues" && exit 1)
@ -548,9 +553,13 @@ jobs:
- test-activate-environment
- test-musl
- test-cache-local
- test-setup-cache
- test-restore-cache
- test-setup-cache-requirements-txt
- test-restore-cache-requirements-txt
- test-setup-cache-dependency-glob
- test-restore-cache-dependency-glob
- test-setup-cache-local
- test-restore-cache-local
- test-tilde-expansion-cache-local-path
- test-tilde-expansion-cache-dependency-glob