Skip to content

Commit ace198d

Browse files
committed
fix docs only CI job processing
Signed-off-by: David Justice <[email protected]>
1 parent 0dadb6b commit ace198d

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

.github/workflows/ValidatePullRequest.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,59 @@ name: Validate Pull Request
55
on:
66
pull_request:
77
branches: [main, "release/**"]
8-
paths-ignore:
9-
- '**.md'
10-
- '**.txt'
118
merge_group:
129

1310
permissions:
1411
id-token: write
1512
contents: read
1613

1714
jobs:
15+
docs-pr:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
docs-only: ${{ steps.docs-only.outputs.result }}
19+
steps:
20+
- uses: dorny/paths-filter@v3
21+
id: changes
22+
with:
23+
filters: |
24+
docs:
25+
- '**/*.md'
26+
- '**/*.txt'
27+
all:
28+
- '**/*'
29+
- uses: actions/github-script@v7
30+
id: docs-only
31+
with:
32+
script: |
33+
let docs_file_count = ${{steps.changes.outputs.docs_count}};
34+
let all_file_count = ${{steps.changes.outputs.all_count}};
35+
console.log(all_file_count > docs_file_count)
36+
result-encoding: string
1837

1938
rust:
39+
needs:
40+
- docs-pr
2041
uses: ./.github/workflows/dep_rust.yml
2142
secrets: inherit
43+
with:
44+
docs_only: ${{needs.docs-pr.outputs.docs-only != 'true'}}
2245
fuzzing:
46+
needs:
47+
- docs-pr
2348
uses: ./.github/workflows/dep_fuzzing.yml
2449
with:
2550
max_total_time: 300 # 5 minutes in seconds
51+
docs_only: ${{needs.docs-pr.outputs.docs-only != 'true'}}
2652
secrets: inherit
2753

2854
#####
2955
# start build-on-windows
3056
#####
3157
build-on-windows:
58+
needs:
59+
- docs-pr
60+
if: ${{needs.docs-pr.outputs.docs-only == 'true'}}
3261
runs-on: ${{ matrix.os }}
3362
strategy:
3463
fail-fast: true
@@ -72,6 +101,9 @@ jobs:
72101
# start build-on-linux
73102
#####
74103
build-on-linux:
104+
needs:
105+
- docs-pr
106+
if: ${{needs.docs-pr.outputs.docs-only == 'true'}}
75107
runs-on: ${{ matrix.os }}
76108
strategy:
77109
fail-fast: true

.github/workflows/dep_fuzzing.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ on:
77
description: Maximum total time for the fuzz run in seconds
88
required: true
99
type: number
10+
docs_only:
11+
description: Skip fuzzing if docs only
12+
required: false
13+
type: string
14+
default: "false"
1015

1116
permissions:
1217
id-token: write
1318
contents: read
1419

1520
jobs:
1621
fuzz:
22+
if: ${{ inputs.docs_only == 'false' }}
1723
runs-on: [ self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd" ]
1824
steps:
1925
- name: Checkout code

.github/workflows/dep_rust.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ name: Rust Tests and Lints
55
# See README.md in this directory for more information about workflow_call
66
on:
77
workflow_call:
8+
inputs:
9+
docs_only:
10+
description: Skip building if docs only
11+
required: false
12+
type: string
13+
default: "false"
814

915
env:
1016
CARGO_TERM_COLOR: always
@@ -16,6 +22,7 @@ permissions:
1622

1723
jobs:
1824
build:
25+
if: ${{ inputs.docs_only == 'false' }}
1926
strategy:
2027
fail-fast: true
2128
matrix:

0 commit comments

Comments
 (0)