diff options
author | bors-servo <infra@servo.org> | 2023-01-17 11:43:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-17 11:43:47 +0100 |
commit | 5a33a91bc909e6de807070fbec11325a554a8766 (patch) | |
tree | 8f77db8b13c3ade0325f61737c81e796a924abb9 | |
parent | b52547b24e08e894045432b21e4b79b440d23c13 (diff) | |
parent | 677414730b21b1932c4a1d708829e290f8e9df1e (diff) | |
download | servo-5a33a91bc909e6de807070fbec11325a554a8766.tar.gz servo-5a33a91bc909e6de807070fbec11325a554a8766.zip |
Auto merge of #29238 - servo:ci-fail-install-deps, r=jdm
Fail faster on CI when Linux bootstrap fails
Raise an exception when dependencies fail to install. Also split the run phase of the Linux bootstrap so that either of these failing commands will cause the job to fail.
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they just change minor script issues.
-rw-r--r-- | .github/workflows/main.yml | 9 | ||||
-rw-r--r-- | .github/workflows/pull-request.yml | 9 | ||||
-rw-r--r-- | python/servo/bootstrap.py | 10 |
3 files changed, 14 insertions, 14 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e853a149c65..81c215c5810 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -222,11 +222,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 2 - - name: Bootstrap - run: | - python3 -m pip install --upgrade pip virtualenv - sudo apt update - python3 ./mach bootstrap + - name: Bootstrap Python + run: python3 -m pip install --upgrade pip virtualenv + - name: Bootstrap dependencies + run: sudo apt update && python3 ./mach bootstrap - name: Release build run: python3 ./mach build --release - name: Lockfile check diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0c5f7ad3165..34099f1f58a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,11 +15,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 2 - - name: Bootstrap - run: | - python3 -m pip install --upgrade pip virtualenv - sudo apt update - python3 ./mach bootstrap + - name: Bootstrap Python + run: python3 -m pip install --upgrade pip virtualenv + - name: Bootstrap dependencies + run: sudo apt update && python3 ./mach bootstrap - name: Release build run: python3 ./mach build --release - name: Unit tests diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py index f14f9381a60..8d6b19fb477 100644 --- a/python/servo/bootstrap.py +++ b/python/servo/bootstrap.py @@ -59,11 +59,13 @@ def install_linux_deps(context, pkgs_ubuntu, pkgs_fedora, pkgs_void, force): install = force = True break - if install: - print("Installing missing dependencies...") - run_as_root(command + pkgs, force) + if not install: + return False - return install + print("Installing missing dependencies...") + if run_as_root(command + pkgs, force) != 0: + raise Exception("Installation of dependencies failed.") + return True def install_salt_dependencies(context, force): |