Skip to content

Commit 89dfbcf

Browse files
Merge pull request #23 from nathanchance/git_repo_ref-build-set
Set git_repo and git_ref in build-set
2 parents 64f2aa2 + 1d96dd5 commit 89dfbcf

File tree

7 files changed

+43
-46
lines changed

7 files changed

+43
-46
lines changed

.github/workflows/mainline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414
- name: tuxbuild
15-
run: tuxbuild build-set --git-repo "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git" --git-ref master --set-name foo-bar --json-out builds.json --tux-config tuxbuild/mainline.tux.yml || true
15+
run: tuxbuild build-set --set-name foo-bar --json-out builds.json --tux-config tuxbuild/mainline.tux.yml || true
1616
- name: save output
1717
uses: actions/upload-artifact@v2
1818
with:

.github/workflows/next.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414
- name: tuxbuild
15-
run: tuxbuild build-set --git-repo "https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git" --git-ref master --set-name foo-bar --json-out builds.json --tux-config tuxbuild/next.tux.yml || true
15+
run: tuxbuild build-set --set-name foo-bar --json-out builds.json --tux-config tuxbuild/next.tux.yml || true
1616
- name: save output
1717
uses: actions/upload-artifact@v2
1818
with:

generate_tuxbuild.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,30 @@ def get_config():
2020
def get_repo_ref(config, tree_name):
2121
for tree in config["trees"]:
2222
if tree["name"] == tree_name:
23-
return tree["repo"], tree["ref"]
23+
return tree["git_repo"], tree["git_ref"]
2424

2525

2626
def emit_tuxbuild_yml(config, tree):
27-
repo, ref = get_repo_ref(config, tree)
2827
print("# DO NOT MODIFY MANUALLY!")
2928
print("# This file has been autogenerated by invoking:")
3029
print("# $ ./generate_tuxbuild.py < generator.yml {} > tuxbuild/{}.tux.yml".format(tree, tree))
3130
print("# Invoke tuxbuild via:")
32-
print("# $ tuxbuild build-set --git-repo '{}' --git-ref {} \\".format(repo, ref))
33-
print("# --set-name foo-bar --json-out builds.json --tux-config {}.tux.yml".format(tree))
31+
print("# $ tuxbuild build-set --set-name foo-bar --json-out builds.json --tux-config {}.tux.yml".format(tree))
3432
print("""\
3533
sets:
3634
- name: foo-bar
3735
builds:\
3836
""")
37+
repo, ref = get_repo_ref(config, tree)
3938
max_version = max(config["llvm_versions"])
4039
for build in config["builds"]:
41-
if build["repo"] == repo and build["ref"] == ref:
40+
if build["git_repo"] == repo and build["git_ref"] == ref:
4241
arch = build["ARCH"] if "ARCH" in build else "x86_64"
4342
toolchain = "clang-"
4443
toolchain += "nightly" if build["llvm_version"] == max_version else str(build["llvm_version"])
4544
kconfig = build["config"]
46-
print(" - {{target_arch: {0}, toolchain: {1}, kconfig: {2}, make_variables: {{LLVM: \"{3}\"}}}}".format(\
47-
arch, toolchain, kconfig, int(build["llvm"])))
45+
print(" - {{git_repo: \"{0}\", git_ref: \"{1}\", target_arch: {2}, toolchain: {3}, kconfig: {4}, make_variables: {{LLVM: \"{5}\"}}}}".format(\
46+
build["git_repo"], build["git_ref"], arch, toolchain, kconfig, int(build["llvm"])))
4847

4948
if __name__ == "__main__":
5049
# The list of valid trees come from the input, so we parse the input, then

generate_workflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get_fragment():
2424
def get_repo_ref(config, tree_name):
2525
for tree in config["trees"]:
2626
if tree["name"] == tree_name:
27-
return tree["repo"], tree["ref"]
27+
return tree["git_repo"], tree["git_ref"]
2828

2929

3030
def get_job_name(build):
@@ -77,11 +77,11 @@ def print_builds(config, tree_name):
7777
fragment["on"] = fragment[True]
7878
del fragment[True]
7979
fragment["jobs"]["kick_tuxbuild"]["steps"][1]["run"] = \
80-
"tuxbuild build-set --git-repo \"{}\" --git-ref {} --set-name foo-bar --json-out builds.json --tux-config tuxbuild/{}.tux.yml || true".format(\
81-
repo, ref, tree_name)
80+
"tuxbuild build-set --set-name foo-bar --json-out builds.json --tux-config tuxbuild/{}.tux.yml || true".format(\
81+
tree_name)
8282

8383
for build in config["builds"]:
84-
if build["repo"] == repo and build["ref"] == ref:
84+
if build["git_repo"] == repo and build["git_ref"] == ref:
8585
steps = get_steps(build)
8686
fragment["jobs"].update(steps)
8787
print("# DO NOT MODIFY MANUALLY!")

generator.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ urls:
77
- &stable-url https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
88
- &android-url https://android.googlesource.com/kernel/common.git
99
trees:
10-
- &mainline {repo: *mainline-url, ref: master, name: mainline}
11-
- &next {repo: *next-url, ref: master, name: next}
12-
- &stable-5_10 {repo: *stable-url, ref: linux-5.10.y, name: "5.10"}
13-
- &stable-5_4 {repo: *stable-url, ref: linux-5.4.y, name: "5.4"}
14-
- &stable-4_19 {repo: *stable-url, ref: linux-4.19.y, name: "4.19"}
15-
- &stable-4_14 {repo: *stable-url, ref: linux-4.14.y, name: "4.14"}
16-
- &stable-4_9 {repo: *stable-url, ref: linux-4.9.y, name: "4.9"}
17-
- &stable-4_4 {repo: *stable-url, ref: linux-4.4.y, name: "4.4"}
18-
- &android-mainline {repo: *android-url, ref: android-mainline, name: android-mainline}
19-
- &android-5_10 {repo: *android-url, ref: android12-5.10, name: android-5.10}
20-
- &android-5_4 {repo: *android-url, ref: android12-5.4, name: android-5.4}
21-
- &android-4_19 {repo: *android-url, ref: android-4.19-stable, name: android-4.19}
22-
- &android-4_14 {repo: *android-url, ref: android-4.14-stable, name: android-4.14}
23-
- &android-4_9 {repo: *android-url, ref: android-4.9-q, name: android-4.9}
10+
- &mainline {git_repo: *mainline-url, git_ref: master, name: mainline}
11+
- &next {git_repo: *next-url, git_ref: master, name: next}
12+
- &stable-5_10 {git_repo: *stable-url, git_ref: linux-5.10.y, name: "5.10"}
13+
- &stable-5_4 {git_repo: *stable-url, git_ref: linux-5.4.y, name: "5.4"}
14+
- &stable-4_19 {git_repo: *stable-url, git_ref: linux-4.19.y, name: "4.19"}
15+
- &stable-4_14 {git_repo: *stable-url, git_ref: linux-4.14.y, name: "4.14"}
16+
- &stable-4_9 {git_repo: *stable-url, git_ref: linux-4.9.y, name: "4.9"}
17+
- &stable-4_4 {git_repo: *stable-url, git_ref: linux-4.4.y, name: "4.4"}
18+
- &android-mainline {git_repo: *android-url, git_ref: android-mainline, name: android-mainline}
19+
- &android-5_10 {git_repo: *android-url, git_ref: android12-5.10, name: android-5.10}
20+
- &android-5_4 {git_repo: *android-url, git_ref: android12-5.4, name: android-5.4}
21+
- &android-4_19 {git_repo: *android-url, git_ref: android-4.19-stable, name: android-4.19}
22+
- &android-4_14 {git_repo: *android-url, git_ref: android-4.14-stable, name: android-4.14}
23+
- &android-4_9 {git_repo: *android-url, git_ref: android-4.9-q, name: android-4.9}
2424
architectures:
2525
- &arm-arch arm
2626
- &arm64-arch arm64

tuxbuild/mainline.tux.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
# This file has been autogenerated by invoking:
33
# $ ./generate_tuxbuild.py < generator.yml mainline > tuxbuild/mainline.tux.yml
44
# Invoke tuxbuild via:
5-
# $ tuxbuild build-set --git-repo 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git' --git-ref master \
6-
# --set-name foo-bar --json-out builds.json --tux-config mainline.tux.yml
5+
# $ tuxbuild build-set --set-name foo-bar --json-out builds.json --tux-config mainline.tux.yml
76
sets:
87
- name: foo-bar
98
builds:
10-
- {target_arch: arm, toolchain: clang-nightly, kconfig: multi_v5_defconfig, make_variables: {LLVM: "1"}}
11-
- {target_arch: arm, toolchain: clang-nightly, kconfig: aspeed_g5_defconfig, make_variables: {LLVM: "1"}}
12-
- {target_arch: arm, toolchain: clang-nightly, kconfig: multi_v7_defconfig, make_variables: {LLVM: "1"}}
13-
- {target_arch: arm64, toolchain: clang-nightly, kconfig: defconfig, make_variables: {LLVM: "1"}}
14-
- {target_arch: x86_64, toolchain: clang-nightly, kconfig: defconfig, make_variables: {LLVM: "1"}}
15-
- {target_arch: arm, toolchain: clang-11, kconfig: multi_v5_defconfig, make_variables: {LLVM: "1"}}
16-
- {target_arch: arm, toolchain: clang-11, kconfig: aspeed_g5_defconfig, make_variables: {LLVM: "1"}}
17-
- {target_arch: arm, toolchain: clang-11, kconfig: multi_v7_defconfig, make_variables: {LLVM: "1"}}
18-
- {target_arch: arm64, toolchain: clang-11, kconfig: defconfig, make_variables: {LLVM: "1"}}
19-
- {target_arch: x86_64, toolchain: clang-11, kconfig: defconfig, make_variables: {LLVM: "1"}}
9+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: arm, toolchain: clang-nightly, kconfig: multi_v5_defconfig, make_variables: {LLVM: "1"}}
10+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: arm, toolchain: clang-nightly, kconfig: aspeed_g5_defconfig, make_variables: {LLVM: "1"}}
11+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: arm, toolchain: clang-nightly, kconfig: multi_v7_defconfig, make_variables: {LLVM: "1"}}
12+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: arm64, toolchain: clang-nightly, kconfig: defconfig, make_variables: {LLVM: "1"}}
13+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: x86_64, toolchain: clang-nightly, kconfig: defconfig, make_variables: {LLVM: "1"}}
14+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: arm, toolchain: clang-11, kconfig: multi_v5_defconfig, make_variables: {LLVM: "1"}}
15+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: arm, toolchain: clang-11, kconfig: aspeed_g5_defconfig, make_variables: {LLVM: "1"}}
16+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: arm, toolchain: clang-11, kconfig: multi_v7_defconfig, make_variables: {LLVM: "1"}}
17+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: arm64, toolchain: clang-11, kconfig: defconfig, make_variables: {LLVM: "1"}}
18+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git", git_ref: "master", target_arch: x86_64, toolchain: clang-11, kconfig: defconfig, make_variables: {LLVM: "1"}}

tuxbuild/next.tux.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
# This file has been autogenerated by invoking:
33
# $ ./generate_tuxbuild.py < generator.yml next > tuxbuild/next.tux.yml
44
# Invoke tuxbuild via:
5-
# $ tuxbuild build-set --git-repo 'https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git' --git-ref master \
6-
# --set-name foo-bar --json-out builds.json --tux-config next.tux.yml
5+
# $ tuxbuild build-set --set-name foo-bar --json-out builds.json --tux-config next.tux.yml
76
sets:
87
- name: foo-bar
98
builds:
10-
- {target_arch: arm, toolchain: clang-nightly, kconfig: multi_v5_defconfig, make_variables: {LLVM: "1"}}
11-
- {target_arch: arm, toolchain: clang-nightly, kconfig: aspeed_g5_defconfig, make_variables: {LLVM: "1"}}
12-
- {target_arch: arm, toolchain: clang-nightly, kconfig: multi_v7_defconfig, make_variables: {LLVM: "1"}}
13-
- {target_arch: arm64, toolchain: clang-nightly, kconfig: defconfig, make_variables: {LLVM: "1"}}
14-
- {target_arch: x86_64, toolchain: clang-nightly, kconfig: defconfig, make_variables: {LLVM: "1"}}
9+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git", git_ref: "master", target_arch: arm, toolchain: clang-nightly, kconfig: multi_v5_defconfig, make_variables: {LLVM: "1"}}
10+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git", git_ref: "master", target_arch: arm, toolchain: clang-nightly, kconfig: aspeed_g5_defconfig, make_variables: {LLVM: "1"}}
11+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git", git_ref: "master", target_arch: arm, toolchain: clang-nightly, kconfig: multi_v7_defconfig, make_variables: {LLVM: "1"}}
12+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git", git_ref: "master", target_arch: arm64, toolchain: clang-nightly, kconfig: defconfig, make_variables: {LLVM: "1"}}
13+
- {git_repo: "https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git", git_ref: "master", target_arch: x86_64, toolchain: clang-nightly, kconfig: defconfig, make_variables: {LLVM: "1"}}

0 commit comments

Comments
 (0)