Skip to content

Commit 39e017a

Browse files
committed
Build list of required jobs in generate-workflow
Dump the list of all the jobs in the same format that is required for configuration in opentelemetry-admin terraform config files so that we don't miss required jobs.
1 parent 196d088 commit 39e017a

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from pathlib import Path
2+
3+
from generate_workflows_lib import (
4+
get_lint_job_datas,
5+
get_test_job_datas,
6+
get_tox_envs,
7+
)
8+
9+
tox_ini_path = Path(__file__).parent.parent.parent.joinpath("tox.ini")
10+
11+
12+
def get_gh_contexts_from_jobs(job_datas):
13+
return [
14+
f""" {{ context = "{job["ui_name"]}" }},\n""" for job in job_datas
15+
]
16+
17+
18+
jobs = sorted(
19+
get_gh_contexts_from_jobs(get_lint_job_datas(get_tox_envs(tox_ini_path)))
20+
+ get_gh_contexts_from_jobs(
21+
get_test_job_datas(get_tox_envs(tox_ini_path), ["ubuntu-latest"])
22+
)
23+
)
24+
with open("opentelemetry-admin-jobs.txt", "w") as f:
25+
for job in jobs:
26+
f.write(job)

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ target
6161

6262
# Benchmark result files
6363
*-benchmark.json
64+
65+
# opentelemetry-admin jobs
66+
opentelemetry-admin-jobs.txt

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,7 @@ deps =
11131113

11141114
commands =
11151115
python {toxinidir}/.github/workflows/generate_workflows.py
1116+
python {toxinidir}/.github/workflows/generate_required_checks.py
11161117

11171118
[testenv:shellcheck]
11181119

0 commit comments

Comments
 (0)