Skip to content

Commit

Permalink
ci: fix catch-all (#7215)
Browse files Browse the repository at this point in the history
* ci: trigger separate workflow

* ci: temporary use current branch

* ci: fix workflow name

* ci: try with same job name

* ci: try with dispatch

* Revert "ci: try with dispatch"

This reverts commit bd66e56.

* Revert "ci: try with same job name"

This reverts commit 9e2ae5b.

* ci: try with workflow call in both cases

* ci: introduce change to trigger CI

* Revert "ci: introduce change to trigger CI"

This reverts commit e3ec07c.

* ci: add name

* Revert "Revert "ci: introduce change to trigger CI""

This reverts commit 6718585.

* ci: improve naming

* ci: further improve naming

* Unset reusable workflow version and use relative path

* Remove CI trigger

---------

Co-authored-by: Silvano Cerza <silvanocerza@gmail.com>
  • Loading branch information
wochinge and silvanocerza committed Apr 29, 2024
1 parent 40360e4 commit 451fae8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,8 @@ jobs:
- "branch:${{ github.ref_name }}"
- "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
catch-all:
name: Catch-all check
runs-on: ubuntu-latest
trigger-catch-all:
name: Tests completed
# This job will be executed only after all the other tests
# are successful.
# This way we'll be able to mark only this test as required
Expand All @@ -353,6 +352,6 @@ jobs:
- integration-tests-linux
- integration-tests-macos
- integration-tests-windows
steps:
- name: Finisher
run: echo "Finish him!"
uses: ./.github/workflows/tests_skipper_workflow.yml
with:
tests_were_skipped: false
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ jobs:
- test/**/*.py
- "pyproject.toml"
catch-all:
trigger-catch-all:
name: Tests completed
# Don't run this check if the PR contains both code and non-code changes (e.g. release notes)
needs: check_if_changed
if: needs.check_if_changed.outputs.code_changes == 'false'
name: Catch-all check
runs-on: ubuntu-latest
steps:
- name: Skip tests
run: echo "Skipped!"
uses: ./.github/workflows/tests_skipper_workflow.yml
with:
tests_were_skipped: true
24 changes: 24 additions & 0 deletions .github/workflows/tests_skipper_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# If you change this name also do it in tests.yml and ci_metrics.yml
# We use a separate workflow to skip the tests if the PR contains both code and non-code changes (e.g. release notes).
# Skipping the job unfortunately doesn't work because GitHub will treat these jobs as successful even if they are
# skipped. Hence, we need to revert to a separate workflow.
name: Tests
on:
workflow_call:
inputs:
tests_were_skipped:
type: boolean
required: true

jobs:
catch-all:
# Don't run this check if the PR contains both code and non-code changes (e.g. release notes)
name: Mark tests as completed
runs-on: ubuntu-latest
steps:
- name: Skip tests
if: ${{ github.event.inputs.tests_were_skipped }}
run: echo "Skipped!"
- name: Tests completed successfully
if: ${{ !github.event.inputs.tests_were_skipped }}
run: echo "Tests completed!"

0 comments on commit 451fae8

Please sign in to comment.