Skip to content

Commit

Permalink
enh(ci): run push and publish jobs only on centreon/centreon-collect (#…
Browse files Browse the repository at this point in the history
…1920)

* enh(ci): run push and publish jobs only on centreon/centreon

* Update .github/workflows/centreon-collect.yml

* Update .github/workflows/centreon-collect.yml

---------

Co-authored-by: May <[email protected]>
  • Loading branch information
tuntoja and mushroomempires authored Dec 17, 2024
1 parent 8d9f0a9 commit d7dfbe2
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 15 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/centreon-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ jobs:
needs.get-environment.outputs.is_nightly == 'true' &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
strategy:
fail-fast: false
Expand Down Expand Up @@ -392,7 +393,8 @@ jobs:
needs.get-environment.outputs.stability == 'stable' &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
steps:
- name: Checkout sources
Expand All @@ -416,7 +418,9 @@ jobs:
contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
needs: [get-environment, robot-test]
runs-on: [self-hosted, common]
strategy:
Expand Down Expand Up @@ -464,7 +468,9 @@ jobs:
contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
needs: [get-environment, robot-test]
runs-on: [self-hosted, common]
strategy:
Expand Down Expand Up @@ -495,7 +501,8 @@ jobs:
if: |
needs.get-environment.outputs.is_nightly == 'true' && github.run_attempt == 1 &&
failure() &&
startsWith(github.ref_name, 'dev')
startsWith(github.ref_name, 'dev') &&
github.repository == 'centreon/centreon-collect'
uses: ./.github/actions/create-jira-ticket
with:
jira_base_url: ${{ secrets.JIRA_BASE_URL }}
Expand All @@ -511,7 +518,9 @@ jobs:
(contains(fromJson('["stable", "testing"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/centreon-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ jobs:
(contains(fromJson('["stable", "testing"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:

jobs:
get-environment:
if: github.repository == 'centreon/centreon-collect'
uses: ./.github/workflows/get-environment.yml
with:
version_file: CMakeLists.txt
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-gorgone-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:

jobs:
get-environment:
if: github.repository == 'centreon/centreon-collect'
uses: ./.github/workflows/get-environment.yml

dockerize:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/gorgone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ jobs:
robot-test-gorgone:
needs: [get-environment, package]
if: |
github.repository == 'centreon/centreon-collect' &&
needs.get-environment.outputs.skip_workflow == 'false' &&
needs.get-environment.outputs.stability != 'stable'
Expand Down Expand Up @@ -383,7 +384,9 @@ jobs:
(contains(fromJson('["stable", "testing"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/libzmq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ jobs:
(contains(fromJson('["stable", "testing"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lua-curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ jobs:
(contains(fromJson('["stable", "testing"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebase-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
main:
name: Sync Stable Branches
runs-on: ubuntu-24.04
if: github.event.pull_request.merged == true
if: github.event.pull_request.merged == true && github.repository == 'centreon/centreon-collect'
steps:
- name: git checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebase-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
main:
name: Sync Stable Branches
runs-on: ubuntu-24.04
if: github.event.pull_request.merged == true
if: github.event.pull_request.merged == true && github.repository == 'centreon/centreon-collect'
steps:
- name: git checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-trigger-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:

jobs:
release-trigger-builds:
if: github.repository == 'centreon/centreon-collect'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
release:
if: ${{ github.event.pull_request.merged == true }}
if: ${{ github.event.pull_request.merged == true && github.repository == 'centreon/centreon-collect' }}
runs-on: ubuntu-24.04
steps:
- name: Check base_ref
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/windows-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ jobs:
contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
! contains(needs.*.result, 'cancelled') &&
github.repository == 'centreon/centreon-collect'
run: |
Write-Host "[DEBUG] deliver to testing - Major version: ${{ needs.get-environment.outputs.major_version }}"
Write-Host "[DEBUG] deliver to testing - Minor version: ${{ needs.get-environment.outputs.minor_version }}"
Expand All @@ -190,7 +191,7 @@ jobs:
- name: Promote testing to stable
if: |
needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch' && ! cancelled()
needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch' && ! cancelled() && github.repository == 'centreon/centreon-collect'
run: |
Write-Host "[DEBUG] promote to stable - Major version: ${{ needs.get-environment.outputs.major_version }}"
Write-Host "[DEBUG] promote to stable - Minor version: ${{ needs.get-environment.outputs.minor_version }}"
Expand Down

2 comments on commit d7dfbe2

@github-actions
Copy link

Choose a reason for hiding this comment

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

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
29 2 0 31 93.55 23m38.281861s

Failed Tests

Name Message ⏱️ Duration Suite
EBNHGU4_BBDO3 hostgroup_1 not found in /tmp/lua-engine.log 80.398 s Hostgroups
not12 The second notification of U2 is not sent 82.494 s Notifications

@github-actions
Copy link

Choose a reason for hiding this comment

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

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
9 1 0 10 90.00 8m43.804938s

Failed Tests

Name Message ⏱️ Duration Suite
Services_and_bulks_2 no metric found for service: None == None 80.413 s Services-And-Bulk-Stmt

Please sign in to comment.