-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI
all
test is the only required test
This means we can just use the `needs` of that test to determine which CI actions are required for status checks to pass.
- Loading branch information
1 parent
65ef8c1
commit a93967a
Showing
2 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Makes sure: | ||
* All jobs are listed in the 'all' job | ||
* Only existing tests are listed | ||
""" | ||
|
||
import sys | ||
import yaml | ||
|
||
CI_PATH = '.github/workflows/ci.yaml' | ||
ALL_TEST = 'all' | ||
|
||
|
||
def main(): | ||
ci_yaml_fp = open(CI_PATH, 'r') | ||
ci_yaml_parsed = yaml.load(ci_yaml_fp, Loader=yaml.FullLoader) | ||
|
||
all_jobs = set(ci_yaml_parsed['jobs'].keys()) - {ALL_TEST} | ||
all_needs = set(ci_yaml_parsed['jobs'][ALL_TEST]['needs']) | ||
|
||
if all_jobs - all_needs: | ||
sys.exit(f'Not all jobs mentioned in {ALL_TEST}.needs: ' | ||
f'{all_jobs - all_needs}') | ||
|
||
if all_needs - all_jobs: | ||
sys.exit(f'Non-existing jobs found in {ALL_TEST}.needs: ' | ||
f'{all_needs - all_jobs}') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters