Skip to content

Commit

Permalink
ci: All jobs should pass for CI to pass (#533)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mrobinson committed Apr 4, 2024
1 parent 38d11ad commit fdbd3bf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/main.yml
Expand Up @@ -51,20 +51,6 @@ jobs:
- run: cargo check --lib --all-features

build_result:
name: Result
runs-on: ubuntu-latest
needs:
- "ci"

steps:
- name: Mark the job as successful
run: exit 0
if: success()
- name: Mark the job as unsuccessful
run: exit 1
if: ${{ !success() }}

lint:
name: Lint
runs-on: ubuntu-latest
Expand All @@ -86,3 +72,20 @@ jobs:

- name: Run clippy
run: cargo clippy --all-features --all-targets -- -D warnings

build_result:
name: Result
runs-on: ubuntu-latest
needs:
- ci
- lint
- msrv

steps:
- name: Success
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: exit 0
- name: Failure
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1

2 changes: 1 addition & 1 deletion html5ever/examples/arena.rs
Expand Up @@ -349,4 +349,4 @@ fn main() {

let arena = typed_arena::Arena::new();
html5ever_parse_slice_into_arena(&bytes, &arena);
}
}
3 changes: 1 addition & 2 deletions html5ever/examples/noop-tokenize.rs
Expand Up @@ -16,7 +16,6 @@ use std::io;
use html5ever::tendril::*;
use html5ever::tokenizer::{BufferQueue, Token, TokenSink, TokenSinkResult, Tokenizer};


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

Expand All @@ -36,7 +35,7 @@ fn main() {
// Read HTML from standard input
let mut chunk = ByteTendril::new();
io::stdin().read_to_tendril(&mut chunk).unwrap();

let mut input = BufferQueue::default();
input.push_back(chunk.try_reinterpret().unwrap());

Expand Down

0 comments on commit fdbd3bf

Please sign in to comment.