From 2e73d27b7949691f8debb7623e8e394b99a596e4 Mon Sep 17 00:00:00 2001 From: kusch lionel Date: Fri, 24 Oct 2025 14:41:45 +0200 Subject: [PATCH 1/2] Update workflow condition --- .github/workflows/call_publish_result.yml | 8 +++++++- .github/workflows/ci.yml | 13 +++++++++++-- .github/workflows/ci_maintenance.yml | 7 +++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/call_publish_result.yml b/.github/workflows/call_publish_result.yml index 9071d6664..9913a3ab5 100644 --- a/.github/workflows/call_publish_result.yml +++ b/.github/workflows/call_publish_result.yml @@ -3,6 +3,11 @@ name: Publish Tests on: # Allows you to run this workflow from another workflow workflow_call: + inputs: + BRANCH_NAME: + description: 'The name of the branch' + required: true + type: string # disable all the permission for the workflow permissions: {} @@ -53,7 +58,7 @@ jobs: # get the branch of the PR if [ $PULL_REQUEST_NUMBER == "null" ] then - BRANCH=main + BRANCH=${{ inputs.BRANCH_NAME }} else BRANCH=pull/$PULL_REQUEST_NUMBER/head fi @@ -119,3 +124,4 @@ jobs: env_vars: OS,PYTHON files: cov-results-${{ env.PYTHON }}-os-${{ env.OS }}/cov-${{ env.PYTHON }}-os-${{ env.OS }}.xml #CHECK: need to be updated when new version are available fail_ci_if_error: true + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0365ed08b..f0dc46f81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: runs-on: ubuntu-latest outputs: COMMIT_MSG: ${{ steps.get_commit_message.outputs.COMMIT_MSG }} + BRANCH_NAME: ${{ steps.get_branch_name.outputs.BRANCH_NAME }} steps: - name: Checkout code uses: actions/checkout@v5 @@ -50,6 +51,12 @@ jobs: echo "$EOF" >> $GITHUB_OUTPUT fi + - name: Get branch name + id: get_branch_name + run: | + echo "BRANCH_NAME=${{ github.event.pull_request.head.ref || github.ref_name }}" >> $GITHUB_OUTPUT + + linter: name: Linter needs: [get_information] @@ -60,14 +67,14 @@ jobs: needs: [linter, get_information] uses: ./.github/workflows/call_test_package.yml with: - skip_test: ${{ contains(needs.get_information.outputs.COMMIT_MSG, '[skip tests]') }} + skip_test: ${{ contains(needs.get_information.outputs.COMMIT_MSG, '[skip tests]') && github.event_name != 'push' }} tests_minimal: name: tests minimal needs: [linter, get_information] uses: ./.github/workflows/call_test_minimal.yml with: - skip_test: ${{ contains(needs.get_information.outputs.COMMIT_MSG, '[skip tests]') }} + skip_test: ${{ contains(needs.get_information.outputs.COMMIT_MSG, '[skip tests]') && github.event_name != 'push' }} tests_publish: name: tests_publish @@ -80,6 +87,8 @@ jobs: pull-requests: write secrets: inherit uses: ./.github/workflows/call_publish_result.yml + with: + BRANCH_NAME: ${{ needs.get_information.outputs.BRANCH_NAME }} # debugger: # needs: linter diff --git a/.github/workflows/ci_maintenance.yml b/.github/workflows/ci_maintenance.yml index f47a3bbb5..d4c22b19b 100644 --- a/.github/workflows/ci_maintenance.yml +++ b/.github/workflows/ci_maintenance.yml @@ -47,6 +47,11 @@ jobs: echo "$EOF" >> $GITHUB_OUTPUT fi + - name: Get branch name + id: get_branch_name + run: | + echo "BRANCH_NAME=${{ github.event.pull_request.head.ref || github.ref_name }}" >> $GITHUB_OUTPUT + linter: name: Linter needs: [get_information] @@ -70,3 +75,5 @@ jobs: pull-requests: write secrets: inherit uses: ./.github/workflows/call_publish_result.yml + with: + BRANCH_NAME: ${{ needs.get_information.outputs.BRANCH_NAME }} From 1116a61000449c73212a4b8a781914b84a64ec13 Mon Sep 17 00:00:00 2001 From: kusch lionel Date: Fri, 24 Oct 2025 15:00:14 +0200 Subject: [PATCH 2/2] fix github ci --- .github/workflows/ci.yml | 7 ++++--- .github/workflows/ci_maintenance.yml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0dc46f81..12bf1ab8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,10 +78,11 @@ jobs: tests_publish: name: tests_publish - needs: [tests] + needs: [tests, get_information] if: | - ${{ github.event.pull_request.draft == false - || contains(needs.get_information.outputs.COMMIT_MSG, '[doc ') + ${{ github.event_name != 'push' && + ( github.event.pull_request.draft == false + || contains(needs.get_information.outputs.COMMIT_MSG, '[doc ') ) }} permissions: pull-requests: write diff --git a/.github/workflows/ci_maintenance.yml b/.github/workflows/ci_maintenance.yml index d4c22b19b..e10990021 100644 --- a/.github/workflows/ci_maintenance.yml +++ b/.github/workflows/ci_maintenance.yml @@ -66,7 +66,7 @@ jobs: tests_publish: name: tests_publish - needs: [tests] + needs: [tests, get_information] if: | ${{ github.event.pull_request.draft == false || contains(needs.get_information.outputs.COMMIT_MSG, '[doc ')