From 78fd3e60c6431151ab8639090fcf7f8835c5d61d Mon Sep 17 00:00:00 2001 From: David Justice Date: Fri, 8 Nov 2024 13:52:39 -0500 Subject: [PATCH] fix docs only CI job processing Signed-off-by: David Justice --- .github/workflows/ValidatePullRequest.yml | 38 +++++++++++++++++++++-- .github/workflows/dep_fuzzing.yml | 6 ++++ .github/workflows/dep_rust.yml | 7 +++++ 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ValidatePullRequest.yml b/.github/workflows/ValidatePullRequest.yml index 26cafdb47..520208674 100644 --- a/.github/workflows/ValidatePullRequest.yml +++ b/.github/workflows/ValidatePullRequest.yml @@ -5,9 +5,6 @@ name: Validate Pull Request on: pull_request: branches: [main, "release/**"] - paths-ignore: - - '**.md' - - '**.txt' merge_group: permissions: @@ -15,20 +12,52 @@ permissions: contents: read jobs: + docs-pr: + runs-on: ubuntu-latest + outputs: + not-just-docs: ${{ steps.not-just-docs.outputs.result }} + steps: + - uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + docs: + - '**/*.md' + - '**/*.txt' + all: + - '**/*' + - uses: actions/github-script@v7 + id: not-just-docs + with: + script: | + let docs_file_count = ${{steps.changes.outputs.docs_count}}; + let all_file_count = ${{steps.changes.outputs.all_count}}; + console.log(all_file_count > docs_file_count) + result-encoding: string rust: + needs: + - docs-pr uses: ./.github/workflows/dep_rust.yml secrets: inherit + with: + docs_only: ${{needs.docs-pr.outputs.not-just-docs != 'true'}} fuzzing: + needs: + - docs-pr uses: ./.github/workflows/dep_fuzzing.yml with: max_total_time: 300 # 5 minutes in seconds + docs_only: ${{needs.docs-pr.outputs.not-just-docs != 'true'}} secrets: inherit ##### # start build-on-windows ##### build-on-windows: + needs: + - docs-pr + if: ${{needs.docs-pr.outputs.not-just-docs == 'true'}} runs-on: ${{ matrix.os }} strategy: fail-fast: true @@ -72,6 +101,9 @@ jobs: # start build-on-linux ##### build-on-linux: + needs: + - docs-pr + if: ${{needs.docs-pr.outputs.not-just-docs == 'true'}} runs-on: ${{ matrix.os }} strategy: fail-fast: true diff --git a/.github/workflows/dep_fuzzing.yml b/.github/workflows/dep_fuzzing.yml index e053d8b87..ad8b5dc5b 100644 --- a/.github/workflows/dep_fuzzing.yml +++ b/.github/workflows/dep_fuzzing.yml @@ -7,6 +7,11 @@ on: description: Maximum total time for the fuzz run in seconds required: true type: number + docs_only: + description: If docs only, don't fuzz, just complete successfully + required: false + type: string + default: "false" permissions: id-token: write @@ -14,6 +19,7 @@ permissions: jobs: fuzz: + if: ${{ inputs.docs_only == 'false' }} runs-on: [ self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd" ] steps: - name: Checkout code diff --git a/.github/workflows/dep_rust.yml b/.github/workflows/dep_rust.yml index 55d0c8d56..a3f890f07 100644 --- a/.github/workflows/dep_rust.yml +++ b/.github/workflows/dep_rust.yml @@ -5,6 +5,12 @@ name: Rust Tests and Lints # See README.md in this directory for more information about workflow_call on: workflow_call: + inputs: + docs_only: + description: If docs only, don't fuzz, just complete successfully + required: false + type: string + default: "false" env: CARGO_TERM_COLOR: always @@ -16,6 +22,7 @@ permissions: jobs: build: + if: ${{ inputs.docs_only == 'false' }} strategy: fail-fast: true matrix: