chore(github): skip some heavy jobs when PR is not related (#6667)

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
This commit is contained in:
Delweng
2024-03-07 03:02:29 +08:00
committed by GitHub
parent b66f54d9eb
commit efa6bbc2df
6 changed files with 38 additions and 13 deletions

View File

@ -2,9 +2,12 @@
on:
pull_request:
paths-ignore: ["etc/**"]
merge_group:
paths-ignore: ["etc/**"]
push:
branches: [main]
paths-ignore: ["etc/**"]
env:
CARGO_TERM_COLOR: always

View File

@ -5,9 +5,12 @@ name: book
on:
push:
branches: [main]
paths-ignore: ["etc/**"]
pull_request:
branches: [main]
paths-ignore: ["etc/**"]
merge_group:
paths-ignore: ["etc/**"]
jobs:
test:

21
.github/workflows/grafana.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: grafana
on:
pull_request:
paths: ["etc/**"]
merge_group:
paths: ["etc/**"]
push:
branches: [main]
paths: ["etc/**"]
jobs:
grafana:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Check dashboard JSON with jq
uses: sergeysova/jq-action@v2
with:
cmd: jq empty etc/grafana/dashboards/overview.json

View File

@ -4,9 +4,12 @@ name: integration
on:
pull_request:
paths-ignore: ["etc/**"]
merge_group:
paths-ignore: ["etc/**"]
push:
branches: [main]
paths-ignore: ["etc/**"]
env:
CARGO_TERM_COLOR: always

View File

@ -2,9 +2,12 @@ name: lint
on:
pull_request:
paths-ignore: ["etc/**"]
merge_group:
paths-ignore: ["etc/**"]
push:
branches: [main]
paths-ignore: ["etc/**"]
env:
CARGO_TERM_COLOR: always
@ -27,8 +30,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run:
cargo clippy --bin "${{ matrix.binary }}" --workspace --features "${{ matrix.network }} asm-keccak jemalloc jemalloc-prof min-error-logs min-warn-logs min-info-logs min-debug-logs min-trace-logs"
- run: cargo clippy --bin "${{ matrix.binary }}" --workspace --features "${{ matrix.network }} asm-keccak jemalloc jemalloc-prof min-error-logs min-warn-logs min-info-logs min-debug-logs min-trace-logs"
env:
RUSTFLAGS: -D warnings
@ -110,21 +112,11 @@ jobs:
components: rustfmt
- run: cargo fmt --all --check
grafana:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Check dashboard JSON with jq
uses: sergeysova/jq-action@v2
with:
cmd: jq empty etc/grafana/dashboards/overview.json
lint-success:
name: lint success
runs-on: ubuntu-latest
if: always()
needs: [clippy-binaries, clippy, crate-checks, docs, fmt, grafana]
needs: [clippy-binaries, clippy, crate-checks, docs, fmt]
timeout-minutes: 30
steps:
- name: Decide whether the needed jobs succeeded or failed

View File

@ -4,9 +4,12 @@ name: unit
on:
pull_request:
paths-ignore: ["etc/**"]
merge_group:
paths-ignore: ["etc/**"]
push:
branches: [main]
paths-ignore: ["etc/**"]
env:
CARGO_TERM_COLOR: always