Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Change CI to not trigger for Draft PRs
Browse files Browse the repository at this point in the history
Since we share a lot of code in Draft PRs with no purpose at all of
running tests for them, it's a waste of time and resources to run the
entire CI each time we push something to a Draft PR or we simply open
one.

Therefore, thanks to @han0110 who found that was possible to avoid this
in the workflow config, it has been added.
Resolves: #145
  • Loading branch information
CPerezz committed Oct 26, 2021
1 parent a40168d commit beea6c4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: CI checks

on: [push, pull_request]
on:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]

## `actions-rs/toolchain@v1` overwrite set to false so that
## `rust-toolchain` is always used and the only source of truth.

jobs:
test:
if: github.event.pull_request.draft == false

name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -27,6 +31,8 @@ jobs:
args: --verbose --release --all --all-features

build:
if: github.event.pull_request.draft == false

name: Build target ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
Expand All @@ -49,6 +55,8 @@ jobs:
args: --all-features

bitrot:
if: github.event.pull_request.draft == false

name: Bitrot check
runs-on: ubuntu-latest

Expand All @@ -65,6 +73,8 @@ jobs:
args: --benches --examples --all-features

doc-links:
if: github.event.pull_request.draft == false

name: Intra-doc links
runs-on: ubuntu-latest

Expand All @@ -87,6 +97,8 @@ jobs:
args: --all --document-private-items

fmt:
if: github.event.pull_request.draft == false

name: Rustfmt
timeout-minutes: 30
runs-on: ubuntu-latest
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/lints-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
name: Stable lints

# We only run these lints on trial-merges of PRs to reduce noise.
on: pull_request
on:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]

jobs:
clippy:
if: github.event.pull_request.draft == false

name: Clippy (1.53.0)
timeout-minutes: 30
runs-on: ubuntu-latest
Expand Down

0 comments on commit beea6c4

Please sign in to comment.