Skip to content
Open
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
8 changes: 7 additions & 1 deletion .github/workflows/call_publish_result.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -60,26 +67,29 @@ 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
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
secrets: inherit
uses: ./.github/workflows/call_publish_result.yml
with:
BRANCH_NAME: ${{ needs.get_information.outputs.BRANCH_NAME }}

# debugger:
# needs: linter
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/ci_maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -61,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 ')
Expand All @@ -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 }}