Skip to content

Commit

Permalink
Properly mark failed CI as failing
Browse files Browse the repository at this point in the history
There was a syntax error in `if` condition for the `Result` CI job.
This meant that when a dependent job failed, the CI pipeline did not.
This should fix branch protection for the merge queue.
  • Loading branch information
mrobinson committed Aug 17, 2023
1 parent 5f69bbe commit fb95f0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ env:

jobs:
mac:
# Run CI only on master in upstream
if: ${{ !(github.repository == 'servo/mozjs' && github.event_name == 'push') || github.ref_name == 'master' }}
if: ${{ github.event_name != 'push' || github.ref_name == 'master' || github.repository != 'servo/mozjs' }}
runs-on: macos-latest
strategy:
fail-fast: false
Expand All @@ -39,8 +38,7 @@ jobs:
cargo build --verbose ${{ matrix.features }}
cargo test --verbose ${{ matrix.features }}
linux:
# Run CI only on master in upstream
if: ${{ !(github.repository == 'servo/mozjs' && github.event_name == 'push') || github.ref_name == 'master' }}
if: ${{ github.event_name != 'push' || github.ref_name == 'master' || github.repository != 'servo/mozjs' }}
env:
RUSTC_WRAPPER: "sccache"
runs-on: ubuntu-latest
Expand All @@ -63,8 +61,7 @@ jobs:
cargo build --verbose ${{ matrix.features }}
cargo test --verbose ${{ matrix.features }}
windows:
# Run CI only on master in upstream
if: ${{ !(github.repository == 'servo/mozjs' && github.event_name == 'push') || github.ref_name == 'master' }}
if: ${{ github.event_name != 'push' || github.ref_name == 'master' || github.repository != 'servo/mozjs' }}
runs-on: windows-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -133,12 +130,12 @@ jobs:
build_result:
name: Result
runs-on: ubuntu-latest
# Integrity check is broken for the time being; don't require it.
needs: ["mac", "linux", "windows"]
if: ${{ always() && github.event_name == 'pull_request' }}
steps:
- name: Mark the job as successful
run: exit 0
if: success()
if: ${{ success() }}
- name: Mark the job as unsuccessful
run: exit 1
if: "!success()"
if: ${{ !success() }}
2 changes: 1 addition & 1 deletion mozjs/src/jsimpls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ impl JS::ObjectOpResult {
}

pub fn fail(&mut self, code: JSErrNum) -> bool {
assert_ne!(code, JS::ObjectOpResult_SpecialCodes::OkCode as usize);
assert_ne!(code, JS::ObjectOpResult_SpecialCodes::OkCode);
self.code_ = code as usize;
true
}
Expand Down

0 comments on commit fb95f0e

Please sign in to comment.