mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
mach try & partitioned try jobs
This commit is contained in:
parent
393902fdc1
commit
332eeb3bbe
2 changed files with 49 additions and 3 deletions
14
.github/workflows/main.yml
vendored
14
.github/workflows/main.yml
vendored
|
@ -35,6 +35,7 @@ jobs:
|
||||||
});
|
});
|
||||||
|
|
||||||
build-win:
|
build-win:
|
||||||
|
if: contains(fromJSON('["auto", "try", "try-windows"]'), github.ref_name)
|
||||||
name: Build (Windows)
|
name: Build (Windows)
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
needs: ["decision"]
|
needs: ["decision"]
|
||||||
|
@ -60,6 +61,7 @@ jobs:
|
||||||
run: python mach smoketest --angle
|
run: python mach smoketest --angle
|
||||||
|
|
||||||
build-mac:
|
build-mac:
|
||||||
|
if: contains(fromJSON('["auto", "try", "try-mac"]'), github.ref_name)
|
||||||
name: Build (macOS)
|
name: Build (macOS)
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
needs: ["decision"]
|
needs: ["decision"]
|
||||||
|
@ -157,6 +159,7 @@ jobs:
|
||||||
# filtered-wpt-summary.${{ matrix.chunk_id }}.log
|
# filtered-wpt-summary.${{ matrix.chunk_id }}.log
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
|
if: contains(fromJSON('["auto", "try", "try-linux", "try-wpt"]'), github.ref_name)
|
||||||
name: Build (Linux)
|
name: Build (Linux)
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: ["decision"]
|
needs: ["decision"]
|
||||||
|
@ -183,6 +186,7 @@ jobs:
|
||||||
path: target.tar.gz
|
path: target.tar.gz
|
||||||
|
|
||||||
linux-wpt:
|
linux-wpt:
|
||||||
|
if: contains(fromJSON('["auto", "try", "try-wpt"]'), github.ref_name)
|
||||||
name: Linux WPT Tests
|
name: Linux WPT Tests
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: ["build-linux"]
|
needs: ["build-linux"]
|
||||||
|
@ -241,7 +245,7 @@ jobs:
|
||||||
report_test_results:
|
report_test_results:
|
||||||
name: Reporting test results
|
name: Reporting test results
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: always()
|
if: "!cancelled() && success('build-linux') && contains(fromJSON('[\"auto\", \"try\", \"try-wpt\"]'), github.ref_name)"
|
||||||
needs:
|
needs:
|
||||||
- "linux-wpt"
|
- "linux-wpt"
|
||||||
steps:
|
steps:
|
||||||
|
@ -269,16 +273,20 @@ jobs:
|
||||||
build_result:
|
build_result:
|
||||||
name: homu build finished
|
name: homu build finished
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: always()
|
||||||
|
# needs all build to detect cancellation
|
||||||
needs:
|
needs:
|
||||||
|
- "decision"
|
||||||
- "build-win"
|
- "build-win"
|
||||||
- "build-mac"
|
- "build-mac"
|
||||||
|
- "build-linux"
|
||||||
- "linux-wpt"
|
- "linux-wpt"
|
||||||
# - "mac-wpt"
|
# - "mac-wpt"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Mark the job as successful
|
- name: Mark the job as successful
|
||||||
run: exit 0
|
run: exit 0
|
||||||
if: success()
|
if: "!contains(join(needs.*.result, ','), 'failure') && !contains(join(needs.*.result, ','), 'cancelled')"
|
||||||
- name: Mark the job as unsuccessful
|
- name: Mark the job as unsuccessful
|
||||||
run: exit 1
|
run: exit 1
|
||||||
if: "!success()"
|
if: contains(join(needs.*.result, ','), 'failure') || contains(join(needs.*.result, ','), 'cancelled')
|
||||||
|
|
|
@ -349,3 +349,41 @@ class MachCommands(CommandBase):
|
||||||
"--verbose",
|
"--verbose",
|
||||||
], env=env)
|
], env=env)
|
||||||
return p.wait()
|
return p.wait()
|
||||||
|
|
||||||
|
@Command('try',
|
||||||
|
description='Runs try jobs by force pushing to personal fork try branches',
|
||||||
|
category='devenv')
|
||||||
|
@CommandArgument(
|
||||||
|
'jobs', default=["try"], nargs='...',
|
||||||
|
help="Name(s) of job(s) (ex: try, linux, mac, windows, wpt)")
|
||||||
|
def try_jobs(self, jobs):
|
||||||
|
branches = []
|
||||||
|
# we validate branches because force pushing is destructive
|
||||||
|
VALID_TRY_BRACHES = ["try", "try-linux", "try-mac", "try-windows", "try-wpt"]
|
||||||
|
for job in jobs:
|
||||||
|
# branches must start with try-
|
||||||
|
if "try" not in job:
|
||||||
|
job = "try-" + job
|
||||||
|
if job not in VALID_TRY_BRACHES:
|
||||||
|
print(job + " job doesn't exist")
|
||||||
|
return -1
|
||||||
|
branches.append(job)
|
||||||
|
remote = "origin"
|
||||||
|
if "servo/servo" in subprocess.check_output(["git", "config", "--get", "remote.origin.url"]).decode():
|
||||||
|
# if we have servo/servo for origin check try remote
|
||||||
|
try:
|
||||||
|
if "servo/servo" in subprocess.check_output(["git", "config", "--get", "remote.try.url"]).decode():
|
||||||
|
# User has servo/servo for try remote
|
||||||
|
print("You should not use servo/servo for try remote!")
|
||||||
|
return -1
|
||||||
|
else:
|
||||||
|
remote = "try"
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
print("It looks like you are patching in upstream servo.")
|
||||||
|
print("Set try remote to your personal fork with `git remote add try https://github.com/user/servo`")
|
||||||
|
return -1
|
||||||
|
for b in branches:
|
||||||
|
res = call(["git", "push", remote, "--force", f"HEAD:{b}"], env=self.build_env())
|
||||||
|
if res != 0:
|
||||||
|
return res
|
||||||
|
return 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue