-
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.
Merge pull request #42 from clash-lang/add-all-check
Add all check to CI
- Loading branch information
Showing
3 changed files
with
71 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,35 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Makes sure: | ||
* All jobs are listed in the 'all' job | ||
* Only existing tests are listed | ||
""" | ||
|
||
# SPDX-FileCopyrightText: 2022 Google LLC | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import sys | ||
import yaml | ||
|
||
CI_PATH = ".github/workflows/ci.yml" | ||
ALL_TEST = "all" | ||
|
||
def main(): | ||
ci_yml_fp = open(CI_PATH, "r") | ||
ci_yml_parsed = yaml.load(ci_yml_fp, Loader=yaml.FullLoader) | ||
|
||
all_jobs = set(ci_yml_parsed['jobs'].keys()) - {ALL_TEST} | ||
all_needs = set(ci_yml_parsed["jobs"][ALL_TEST]["needs"]) | ||
|
||
if all_jobs - all_needs: | ||
sys.exit(f"Not all jobs mentioned in {ALL_TEST}.needs: {all_jobs - all_needs}") | ||
|
||
if all_needs - all_jobs: | ||
sys.exit(f"Non-existing jobs found in {ALL_TEST}.needs: {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
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