Skip to content

Commit

Permalink
fix docs only CI job processing (#48)
Browse files Browse the repository at this point in the history
Signed-off-by: David Justice <[email protected]>
  • Loading branch information
devigned authored Nov 8, 2024
1 parent 0dadb6b commit aab793c
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 9 deletions.
38 changes: 35 additions & 3 deletions .github/workflows/ValidatePullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,59 @@ name: Validate Pull Request
on:
pull_request:
branches: [main, "release/**"]
paths-ignore:
- '**.md'
- '**.txt'
merge_group:

permissions:
id-token: write
contents: read

jobs:
docs-pr:
runs-on: ubuntu-latest
outputs:
docs-only: ${{ steps.docs-only.outputs.result }}
steps:
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
docs:
- '**/*.md'
- '**/*.txt'
all:
- '**/*'
- uses: actions/github-script@v7
id: docs-only
with:
script: |
let docs_file_count = ${{steps.changes.outputs.docs_count}};
let all_file_count = ${{steps.changes.outputs.all_count}};
return 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.docs-only}}
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.docs-only}}
secrets: inherit

#####
# start build-on-windows
#####
build-on-windows:
needs:
- docs-pr
if: ${{needs.docs-pr.outputs.docs-only != 'true'}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
Expand Down Expand Up @@ -72,6 +101,9 @@ jobs:
# start build-on-linux
#####
build-on-linux:
needs:
- docs-pr
if: ${{needs.docs-pr.outputs.docs-only != 'true'}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/dep_fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ on:
description: Maximum total time for the fuzz run in seconds
required: true
type: number
docs_only:
description: Skip fuzzing if docs only
required: false
type: string
default: "false"

permissions:
id-token: write
contents: read

jobs:
fuzz:
if: ${{ inputs.docs_only == 'false' }}
runs-on: [ self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd" ]
steps:
- name: Checkout code
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/dep_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: Skip building if docs only
required: false
type: string
default: "false"

env:
CARGO_TERM_COLOR: always
Expand All @@ -16,6 +22,7 @@ permissions:

jobs:
build:
if: ${{ inputs.docs_only == 'false' }}
strategy:
fail-fast: true
matrix:
Expand Down
25 changes: 22 additions & 3 deletions src/tests/rust_guests/callbackguest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 22 additions & 3 deletions src/tests/rust_guests/simpleguest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aab793c

Please sign in to comment.