Skip to content

.github/workflows: Avoid running CI on markdown-only pull requests #2500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
name: build
on:
push:
pull_request:
paths-ignore:
- '**/*.md'
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's alternative actions we can use but I wasn't a huge fan of their ignore filtering behaviors when playing around with them locally. Another viable alternative would be to perform this filtering ourselves through the REST API using the /pulls/<PR #>/files endpoint.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's likely a couple of more alternatives the more I think about:

  • Run CI on every PR, regardless of content. This is the most costly option but most of the CI runs we like to skip are markdown-only PRs and most of the OLM documentation is housed in another repository.
  • Dynamically determine required checks; this would require removing required status checks entirely and updating our tide configuration to accommodate that requirement
  • Dynamically determine when to skip certain required checks (which is what this PR attempts to do)
    • Use the rest API and parse through the list of files that were changed in the PR
    • Use a custom action to perform this filtering as a job that runs before any CI-related jobs (e.g. a prerequisite job)
    • Could also play around with a workflow_dispatch singleton that triggers CI-related jobs but we'd likely run into the same issue of filtering + existing required status checks blocking PRs

with:
paths_ignore: '["**/*.md"]'
cancel_others: 'true'
concurrent_skipping: 'outdated_runs'
skip_after_successful_duplicate: 'true'
image:
runs-on: ubuntu-latest
needs: skip_check
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ on:
branches:
- master
pull_request:
paths-ignore:
- '**/*.md'
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
paths_ignore: '["**/*.md"]'
cancel_others: 'true'
concurrent_skipping: 'outdated_runs'
skip_after_successful_duplicate: 'true'
e2e-tests:
runs-on: ubuntu-latest
needs: skip_check
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/run-kind-local.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
name: run-olm-kind
on:
pull_request:
paths-ignore:
- '**/*.md'
schedule:
- cron: '0 0 * * *' # daily to pick up releases
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
paths_ignore: '["**/*.md"]'
cancel_others: 'true'
concurrent_skipping: 'outdated_runs'
skip_after_successful_duplicate: 'true'
e2e-kind:
runs-on: ubuntu-latest
needs: skip_check
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/run-minikube-local.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
name: run-olm-minikube
on:
pull_request:
paths-ignore:
- '**/*.md'
schedule:
- cron: '0 0 * * *' # daily to pick up releases
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
paths_ignore: '["**/*.md"]'
cancel_others: 'true'
concurrent_skipping: 'outdated_runs'
skip_after_successful_duplicate: 'true'
e2e-minikube:
runs-on: ubuntu-latest
needs: skip_check
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ on:
branches:
- '**'
pull_request:
paths-ignore:
- '**/*.md'
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
paths_ignore: '["**/*.md"]'
cancel_others: 'true'
concurrent_skipping: 'outdated_runs'
skip_after_successful_duplicate: 'true'
sanity:
runs-on: ubuntu-latest
needs: skip_check
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ on:
branches:
- master
pull_request:
paths-ignore:
- '**/*.md'
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
paths_ignore: '["**/*.md"]'
cancel_others: 'true'
concurrent_skipping: 'outdated_runs'
skip_after_successful_duplicate: 'true'
unit:
runs-on: ubuntu-latest
needs: skip_check
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ on:
branches:
- master
pull_request:
paths-ignore:
- '**/*.md'
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
paths_ignore: '["**/*.md"]'
cancel_others: 'true'
concurrent_skipping: 'outdated_runs'
skip_after_successful_duplicate: 'true'
verify:
runs-on: ubuntu-latest
needs: skip_check
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand Down