Skip to content

Commit

Permalink
enh(ci): add has_changes policy to gorgone (#2013)
Browse files Browse the repository at this point in the history
* enh(ci): add has_changes policy to gorgone

* rationalize the filters

* push empty commit to solve ci
  • Loading branch information
mushroomempires authored Jan 16, 2025
1 parent b86ff0a commit 0910888
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions .github/workflows/gorgone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,35 @@ jobs:
with:
version_file: .version.centreon-gorgone

changes:
needs: [get-environment]
runs-on: ubuntu-24.04
outputs:
trigger_delivery: ${{ steps.filter.outputs.trigger_delivery || 'true' }}
trigger_unit_tests: ${{ steps.filter.outputs.trigger_unit_tests || 'true' }}
trigger_robot_tests: ${{ steps.filter.outputs.trigger_robot_tests || 'true' }}
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
if: ${{ needs.get-environment.outputs.is_nightly == 'false' }}
with:
filters: |
trigger_unit_tests:
- '/gorgone/**'
- '/perl-libs/**'
trigger_robot_tests:
- '/gorgone/!(tests)/**'
- '/gorgone/tests/robot/**'
- '/perl-libs/**'
trigger_delivery:
- '/gorgone/!(tests)/**'
- '/perl-libs/!(lib)/**'
- '/perl-libs/lib/!(t)/**'
- '/perl-libs/*'
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

veracode-analysis:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.is_targeting_feature_branch != 'true' && github.event.pull_request.draft != 'true' }}
Expand All @@ -68,11 +97,12 @@ jobs:
docker_registry_passwd: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}

unit-test-perl:
needs: [get-environment]
needs: [get-environment, changes]
if: |
github.event.inputs.unit_tests == 'true' &&
needs.get-environment.outputs.skip_workflow == 'false' &&
needs.get-environment.outputs.stability != 'stable'
needs.get-environment.outputs.stability != 'stable' &&
needs.changes.outputs.trigger_unit_tests == 'true'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -189,11 +219,12 @@ jobs:
stability: ${{ needs.get-environment.outputs.stability }}

robot-test-gorgone:
needs: [get-environment, package]
needs: [get-environment, package, changes]
if: |
github.repository == 'centreon/centreon-collect' &&
needs.get-environment.outputs.skip_workflow == 'false' &&
needs.get-environment.outputs.stability != 'stable'
needs.get-environment.outputs.stability != 'stable' &&
needs.changes.outputs.trigger_robot_tests == 'true'
strategy:
fail-fast: false
Expand Down Expand Up @@ -328,9 +359,10 @@ jobs:

deliver-rpm:
runs-on: [self-hosted, common]
needs: [get-environment, unit-test-perl, robot-test-gorgone]
needs: [get-environment, unit-test-perl, robot-test-gorgone, changes]
if: |
needs.get-environment.outputs.skip_workflow == 'false' &&
needs.changes.outputs.trigger_delivery == 'true' &&
contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
Expand Down Expand Up @@ -358,9 +390,10 @@ jobs:

deliver-deb:
runs-on: [self-hosted, common]
needs: [get-environment, unit-test-perl, robot-test-gorgone]
needs: [get-environment, unit-test-perl, robot-test-gorgone, changes]
if: |
needs.get-environment.outputs.skip_workflow == 'false' &&
needs.changes.outputs.trigger_delivery == 'true' &&
contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
Expand Down

0 comments on commit 0910888

Please sign in to comment.