Skip to content

Commit fdbd3bf

Browse files
authored
ci: All jobs should pass for CI to pass (#533)
This change makes it so that CI does not pass unless all jobs defined in the workflow file pass. This is necessary in order to prevent landing changes that break CI jobs. `success()` and `failure()` which were used before do not take into account dependent jobs. This also fixes the "lint" job which was failing, by formatting the code.
1 parent 38d11ad commit fdbd3bf

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,6 @@ jobs:
5151
5252
- run: cargo check --lib --all-features
5353

54-
build_result:
55-
name: Result
56-
runs-on: ubuntu-latest
57-
needs:
58-
- "ci"
59-
60-
steps:
61-
- name: Mark the job as successful
62-
run: exit 0
63-
if: success()
64-
- name: Mark the job as unsuccessful
65-
run: exit 1
66-
if: ${{ !success() }}
67-
6854
lint:
6955
name: Lint
7056
runs-on: ubuntu-latest
@@ -86,3 +72,20 @@ jobs:
8672

8773
- name: Run clippy
8874
run: cargo clippy --all-features --all-targets -- -D warnings
75+
76+
build_result:
77+
name: Result
78+
runs-on: ubuntu-latest
79+
needs:
80+
- ci
81+
- lint
82+
- msrv
83+
84+
steps:
85+
- name: Success
86+
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
87+
run: exit 0
88+
- name: Failure
89+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
90+
run: exit 1
91+

html5ever/examples/arena.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,4 @@ fn main() {
349349

350350
let arena = typed_arena::Arena::new();
351351
html5ever_parse_slice_into_arena(&bytes, &arena);
352-
}
352+
}

html5ever/examples/noop-tokenize.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::io;
1616
use html5ever::tendril::*;
1717
use html5ever::tokenizer::{BufferQueue, Token, TokenSink, TokenSinkResult, Tokenizer};
1818

19-
2019
/// In our case, our sink only contains a tokens vector
2120
struct Sink(Vec<Token>);
2221

@@ -36,7 +35,7 @@ fn main() {
3635
// Read HTML from standard input
3736
let mut chunk = ByteTendril::new();
3837
io::stdin().read_to_tendril(&mut chunk).unwrap();
39-
38+
4039
let mut input = BufferQueue::default();
4140
input.push_back(chunk.try_reinterpret().unwrap());
4241

0 commit comments

Comments
 (0)