From 935ed0ca72d694f86e3514da549db34336e98f6e Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:27:04 +0100 Subject: [PATCH 01/12] Refactor CI for forked repositories - test --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 16667f5e..a2d8aec2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,4 +1,5 @@ name: 'CI' + on: # Build any PRs and main branch changes workflow_dispatch: # Allows to run the workflow manually from the Actions tab pull_request: From 8151cfd9638f67d8344813376ea135f086244c85 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 09:56:34 +0100 Subject: [PATCH 02/12] Test updated version --- .github/workflows/CI-test.yml | 276 ++++++++++++++++++++++++++ .github/workflows/CI.yml | 20 +- .github/workflows/coverage-upload.yml | 9 +- 3 files changed, 291 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/CI-test.yml diff --git a/.github/workflows/CI-test.yml b/.github/workflows/CI-test.yml new file mode 100644 index 00000000..3af395aa --- /dev/null +++ b/.github/workflows/CI-test.yml @@ -0,0 +1,276 @@ +name: 'CI-test' + +on: # Build any PRs and main branch changes + pull_request: + types: + - opened + - synchronize + +concurrency: + group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" + cancel-in-progress: true + +jobs: + debug-context: + name: DEBUG - context + runs-on: ubuntu-latest + steps: + - run: | + echo '{' + echo '"github.action": ${{ toJson(github.action) }},' + echo '"github.action_path": ${{ toJson(github.action_path) }},' + echo '"github.action_ref": ${{ toJson(github.action_ref) }},' + echo '"github.action_repository": ${{ toJson(github.action_repository) }},' + echo '"github.action_status": ${{ toJson(github.action_status) }},' + echo '"github.actor": ${{ toJson(github.actor) }},' + echo '"github.actor_id": ${{ toJson(github.actor_id) }},' + echo '"github.base_ref": ${{ toJson(github.base_ref) }},' + echo '"github.event": ${{ toJson(github.event) }},' + echo '"github.event_name": ${{ toJson(github.event_name) }},' + echo '"github.event_path": ${{ toJson(github.event_path) }},' + echo '"github.head_ref": ${{ toJson(github.head_ref) }},' + echo '"github.job": ${{ toJson(github.job) }},' + echo '"github.path": ${{ toJson(github.path) }},' + echo '"github.ref": ${{ toJson(github.ref) }},' + echo '"github.ref_name": ${{ toJson(github.ref_name) }},' + echo '"github.ref_protected": ${{ toJson(github.ref_protected) }},' + echo '"github.ref_type": ${{ toJson(github.ref_type) }},' + echo '"github.repository": ${{ toJson(github.repository) }},' + echo '"github.repository_id": ${{ toJson(github.repository_id) }},' + echo '"github.repository_owner": ${{ toJson(github.repository_owner) }},' + echo '"github.repository_owner_id": ${{ toJson(github.repository_owner_id) }},' + echo '"github.repositoryUrl": ${{ toJson(github.repositoryUrl) }},' + echo '"github.run_id": ${{ toJson(github.run_id) }},' + echo '"github.run_number": ${{ toJson(github.run_number) }},' + echo '"github.run_attempt": ${{ toJson(github.run_attempt) }},' + echo '"github.sha": ${{ toJson(github.sha) }},' + echo '"github.triggering_actor": ${{ toJson(github.triggering_actor) }},' + echo '"github.workflow": ${{ toJson(github.workflow) }},' + echo '"github.workflow_ref": ${{ toJson(github.workflow_ref) }},' + echo '"github.workflow_sha": ${{ toJson(github.workflow_sha) }},' + echo '"github.workspace": ${{ toJson(github.workspace) }}' + echo '}' + + + tests: + name: UTs & FTs - PHP ${{ matrix.php-version }} + runs-on: ubuntu-latest + env: + COVERAGE_TYPE: xdebug + COVERAGE_OUTPUT_STYLE: clover + strategy: + fail-fast: true + max-parallel: 4 + matrix: + include: + # Bare minimum => Lowest versions allowed by composer config + - php-version: '8.0' + composer-flag: --prefer-lowest + # Up-to-date versions => Latest versions allowed by composer config + - php-version: '8.2' + steps: + - name: Check out code + uses: actions/checkout@v3 + +# @TODO Figure out if coverage for every version is actually useful or not +# - name: Enable coverage +# if: ${{ matrix.php-version == '8.2' }} +# run: | +# echo "COVERAGE_OUTPUT_STYLE=clover" >> $GITHUB_ENV +# echo "COVERAGE_TYPE=xdebug" >> $GITHUB_ENV + + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + env: + update: true # Always use latest available patch for the version + fail-fast: true # step will fail if an extension or tool fails to set up + with: + php-version: '${{ matrix.php-version }}' + tools: composer + coverage: ${{ env.COVERAGE_TYPE }} + + - name: Setup cache + id: cache + uses: actions/cache@v3 + with: + path: | + ~/.composer + ./vendor + # Clear the cache if composer json (as composer.lock is in the repo) has been updated + key: tests-${{ matrix.php-version }}-${{ matrix.composer-flag }}-${{ hashFiles('composer.json') }} + + - name: Build + run: | + make build + + - name: Tests + run: make test-unit && make test-functional + + - name: Create "unit tests" reports directory + if: ${{ env.COVERAGE_TYPE == 'xdebug' }} + id: unit-tests-coverage-group + uses: yoanm/temp-reports-group-workspace/gha-create@improve + with: + name: unit-tests + format: clover + files: build/coverage-phpunit/unit.clover + flags: | + unit-tests + php-${{ matrix.php-version }} + path: build/coverage-groups + + - name: Create "functional tests" coverage group + if: ${{ env.COVERAGE_TYPE == 'xdebug' }} + id: functional-tests-coverage-group + uses: yoanm/temp-reports-group-workspace/gha-create@improve + with: + name: functional-tests + format: clover + files: | + build/coverage-phpunit/functional.clover + build/coverage-behat/clover.xml + flags: | + functional-tests + php-${{ matrix.php-version }} + path: build/coverage-groups + + - name: Upload coverage reports + if: ${{ env.COVERAGE_TYPE == 'xdebug' }} + uses: actions/upload-artifact@v4 + with: + name: coverage-groups-php${{ matrix.php-version }} + path: build/coverage-groups + if-no-files-found: error + + static-checks: + name: Static checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP 8.2 + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 # Latest supported + tools: composer + coverage: none + env: + # Always use latest available patch for the version + update: true + + - name: Setup cache + id: cache + uses: actions/cache@v3 + with: + path: | + ~/.composer + # Clear the cache if composer json (as composer.lock is in the repo) has been updated + key: tests-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }} + + - name: Build + run: make build + + - name: ComposerRequireChecker + uses: docker://webfactory/composer-require-checker:4.5.0 + + - name: Dependencies check + if: ${{ github.event_name == 'pull_request' }} + uses: actions/dependency-review-action@v1 + + nightly-tests: + name: Nightly - PHP ${{ matrix.php-version }} + runs-on: ubuntu-latest + env: + COMPOSER_OPTIONS: '--optimize-autoloader --ignore-platform-req=php+' + continue-on-error: true + needs: [ static-checks, tests ] + strategy: + fail-fast: false + max-parallel: 4 + matrix: + php-version: + - '8.3' # Current php dev version + + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: '${{ matrix.php-version }}' + tools: composer + coverage: none + env: + # Always use latest available patch for the version + update: true + + - name: Setup cache + id: cache + uses: actions/cache@v3 + with: + path: | + ~/.composer + ./vendor + # Clear the cache if composer json (as composer.lock is in the repo) has been updated + key: tests-${{ matrix.php-version }}-${{ hashFiles('composer.json') }} + + - name: Build + run: | + make build + + - name: Test + run: make test-unit && make test-functional + + + fetch-info: + name: Fetch triggering workflow metadata + needs: [tests, static-checks, nightly-tests] + runs-on: ubuntu-latest + permissions: + contents: read + checks: write # For the check run creation ! + steps: + - name: 'Check run ○' + uses: yoanm/temp-reports-group-workspace/gha-attach-check-run-to-triggering-workflow@improve + with: + name: 'Fetch coverage info' + fails-on-triggering-workflow-failure: true + + - uses: yoanm/temp-reports-group-workspace/gha-fetch-workflow-metadata@improve + id: fetch-workflow-metadata + outputs: + commit-sha: ${{ steps.fetch-workflow-metadata.outputs.commit-sha }} + run-id: ${{ steps.fetch-workflow-metadata.outputs.run-id }} + + codacy-uploader: + name: Codacy + needs: [ fetch-info ] + uses: yoanm/temp-reports-group-workspace/.github/workflows/codacy-upload-from-artifacts.yml@improve + permissions: + contents: read + checks: write # For the check run creation ! + secrets: + PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + with: + artifacts-pattern: coverage-groups-* + run-id: ${{ needs.fetch-info.outputs.run-id }} + #override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it ! + + codecov-uploader: + name: Codecov + needs: [ fetch-info ] + uses: yoanm/temp-reports-group-workspace/.github/workflows/codecov-upload-from-artifacts.yml@improve + permissions: + contents: read + checks: write # For the check run creation ! + secrets: + TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + artifacts-pattern: coverage-groups-* + run-id: ${{ needs.fetch-info.outputs.run-id }} + override-commit: ${{ needs.fetch-info.outputs.commit-sha }} + override-branch: ${{ needs.fetch-info.outputs.branch }} + override-pr: ${{ needs.fetch-info.outputs.pr-number }} + override-build: ${{ needs.fetch-info.outputs.run-id }} + override-build-url: ${{ needs.fetch-info.outputs.run-url }} diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a2d8aec2..ec052c9f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,14 +2,14 @@ name: 'CI' on: # Build any PRs and main branch changes workflow_dispatch: # Allows to run the workflow manually from the Actions tab - pull_request: - types: - - opened - - synchronize - push: - branches: [ master ] - schedule: - - cron: '0 0 1 * *' # Every month +# pull_request: +# types: +# - opened +# - synchronize +# push: +# branches: [ master ] +# schedule: +# - cron: '0 0 1 * *' # Every month concurrency: group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" @@ -77,7 +77,7 @@ jobs: - name: Create "unit tests" reports directory if: ${{ env.COVERAGE_TYPE == 'xdebug' }} id: unit-tests-coverage-group - uses: yoanm/temp-reports-group-workspace/.github/actions/create-action@develop + uses: yoanm/temp-reports-group-workspace/gha-create@improve with: name: unit-tests format: clover @@ -90,7 +90,7 @@ jobs: - name: Create "functional tests" coverage group if: ${{ env.COVERAGE_TYPE == 'xdebug' }} id: functional-tests-coverage-group - uses: yoanm/temp-reports-group-workspace/.github/actions/create-action@develop + uses: yoanm/temp-reports-group-workspace/gha-create@improve with: name: functional-tests format: clover diff --git a/.github/workflows/coverage-upload.yml b/.github/workflows/coverage-upload.yml index 8a6c8956..3654fcf8 100644 --- a/.github/workflows/coverage-upload.yml +++ b/.github/workflows/coverage-upload.yml @@ -13,12 +13,12 @@ jobs: checks: write # For the check run creation ! steps: - name: 'Check run ○' - uses: yoanm/temp-reports-group-workspace/.github/actions/attach-check-run-to-triggering-workflow-action@develop + uses: yoanm/temp-reports-group-workspace/gha-attach-check-run-to-triggering-workflow@improve with: name: 'Fetch coverage info' fails-on-triggering-workflow-failure: true - - uses: yoanm/temp-reports-group-workspace/.github/actions/fetch-workflow-metadata-action@develop + - uses: yoanm/temp-reports-group-workspace/gha-fetch-workflow-metadata@improve id: fetch-workflow-metadata outputs: @@ -28,7 +28,7 @@ jobs: codacy-uploader: name: Codacy needs: [fetch-info] - uses: yoanm/temp-reports-group-workspace/.github/workflows/codacy-upload-from-artifacts.yml@develop + uses: yoanm/temp-reports-group-workspace/.github/workflows/codacy-upload-from-artifacts.yml@improve permissions: contents: read checks: write # For the check run creation ! @@ -37,11 +37,12 @@ jobs: with: artifacts-pattern: coverage-groups-* run-id: ${{ needs.fetch-info.outputs.run-id }} + #override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it ! codecov-uploader: name: Codecov needs: [fetch-info] - uses: yoanm/temp-reports-group-workspace/.github/workflows/codecov-upload-from-artifacts.yml@develop + uses: yoanm/temp-reports-group-workspace/.github/workflows/codecov-upload-from-artifacts.yml@improve permissions: contents: read checks: write # For the check run creation ! From a08fd17daccdce0729b5efa8c12ee84ca78dfe62 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:11:49 +0100 Subject: [PATCH 03/12] Trigger CI From 04b1601c9267f61655ac9489e7c966cf1c81fbc0 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:27:36 +0100 Subject: [PATCH 04/12] Trigger CI From a5de4178aa6bdc19c59a73f84f8632d751a9418f Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:50:38 +0100 Subject: [PATCH 05/12] Try reusable workflows to ease the whole thing --- .github/workflows/CI.yml | 23 ++-- .github/workflows/pre-check-CI-updates.yml | 37 ++++++ .../{CI-test.yml => reusable-CI-workflow.yml} | 124 ++---------------- .../reusable-coverage-upload-workflow.yml | 105 +++++++++++++++ 4 files changed, 171 insertions(+), 118 deletions(-) create mode 100644 .github/workflows/pre-check-CI-updates.yml rename .github/workflows/{CI-test.yml => reusable-CI-workflow.yml} (50%) create mode 100644 .github/workflows/reusable-coverage-upload-workflow.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ec052c9f..b1365edd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,14 +2,21 @@ name: 'CI' on: # Build any PRs and main branch changes workflow_dispatch: # Allows to run the workflow manually from the Actions tab -# pull_request: -# types: -# - opened -# - synchronize -# push: -# branches: [ master ] -# schedule: -# - cron: '0 0 1 * *' # Every month + pull_request: + types: + - opened + - synchronize + paths-ignore: + # In case of updates to those workflows, they must be pre-check by pre-check-CI-updates.yml instead ! + - '.github/workflows/pre-check-CI-updates.yml' # This workflow + - '.github/workflows/CI.yml' + - '.github/workflows/coverage-upload.yml' + - '.github/workflows/reusable-CI-workflow.yml' + - '.github/workflows/reusable-coverage-upload-workflow.yml' + push: + branches: [ master ] + schedule: + - cron: '0 0 1 * *' # Every month concurrency: group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" diff --git a/.github/workflows/pre-check-CI-updates.yml b/.github/workflows/pre-check-CI-updates.yml new file mode 100644 index 00000000..25e879f9 --- /dev/null +++ b/.github/workflows/pre-check-CI-updates.yml @@ -0,0 +1,37 @@ +name: 'Test CI updates' +description: | + As CI workflow relies on `workflow_run` trigger for upload, this workflow is used in order to ease updates made on + CI workflow (or linked workflows/actions). It's kind of pre-check to ensure once updates are merged on main branch, + the `workflow_run` workflow execution will behave as expected. + +on: # Build any PRs and main branch changes + pull_request: + types: + - opened + - synchronize + branches: [master] # Only for PR targeting master branch + paths: # /!\ Duplicate the same list as `on.pull_request.paths-ignore` property value for CI workflow ! + - '.github/workflows/pre-check-CI-updates.yml' # This workflow + - '.github/workflows/CI.yml' + - '.github/workflows/coverage-upload.yml' + - '.github/workflows/reusable-CI-workflow.yml' + - '.github/workflows/reusable-coverage-upload-workflow.yml' + + +concurrency: + group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" + cancel-in-progress: true + +jobs: + tests: + name: Tests + permissions: + contents: read + uses: ./.github/workflows/reusable-CI-workflow.yml + + upload: + name: Upload + permissions: + contents: read + checks: write # For the check run creation ! + uses: ./.github/workflows/reusable-coverage-upload-workflow.yml diff --git a/.github/workflows/CI-test.yml b/.github/workflows/reusable-CI-workflow.yml similarity index 50% rename from .github/workflows/CI-test.yml rename to .github/workflows/reusable-CI-workflow.yml index 3af395aa..1f40fb29 100644 --- a/.github/workflows/CI-test.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -1,57 +1,14 @@ -name: 'CI-test' +name: 'CI reusable workflow' -on: # Build any PRs and main branch changes - pull_request: - types: - - opened - - synchronize +on: + workflow_call: -concurrency: - group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" - cancel-in-progress: true - -jobs: - debug-context: - name: DEBUG - context - runs-on: ubuntu-latest - steps: - - run: | - echo '{' - echo '"github.action": ${{ toJson(github.action) }},' - echo '"github.action_path": ${{ toJson(github.action_path) }},' - echo '"github.action_ref": ${{ toJson(github.action_ref) }},' - echo '"github.action_repository": ${{ toJson(github.action_repository) }},' - echo '"github.action_status": ${{ toJson(github.action_status) }},' - echo '"github.actor": ${{ toJson(github.actor) }},' - echo '"github.actor_id": ${{ toJson(github.actor_id) }},' - echo '"github.base_ref": ${{ toJson(github.base_ref) }},' - echo '"github.event": ${{ toJson(github.event) }},' - echo '"github.event_name": ${{ toJson(github.event_name) }},' - echo '"github.event_path": ${{ toJson(github.event_path) }},' - echo '"github.head_ref": ${{ toJson(github.head_ref) }},' - echo '"github.job": ${{ toJson(github.job) }},' - echo '"github.path": ${{ toJson(github.path) }},' - echo '"github.ref": ${{ toJson(github.ref) }},' - echo '"github.ref_name": ${{ toJson(github.ref_name) }},' - echo '"github.ref_protected": ${{ toJson(github.ref_protected) }},' - echo '"github.ref_type": ${{ toJson(github.ref_type) }},' - echo '"github.repository": ${{ toJson(github.repository) }},' - echo '"github.repository_id": ${{ toJson(github.repository_id) }},' - echo '"github.repository_owner": ${{ toJson(github.repository_owner) }},' - echo '"github.repository_owner_id": ${{ toJson(github.repository_owner_id) }},' - echo '"github.repositoryUrl": ${{ toJson(github.repositoryUrl) }},' - echo '"github.run_id": ${{ toJson(github.run_id) }},' - echo '"github.run_number": ${{ toJson(github.run_number) }},' - echo '"github.run_attempt": ${{ toJson(github.run_attempt) }},' - echo '"github.sha": ${{ toJson(github.sha) }},' - echo '"github.triggering_actor": ${{ toJson(github.triggering_actor) }},' - echo '"github.workflow": ${{ toJson(github.workflow) }},' - echo '"github.workflow_ref": ${{ toJson(github.workflow_ref) }},' - echo '"github.workflow_sha": ${{ toJson(github.workflow_sha) }},' - echo '"github.workspace": ${{ toJson(github.workspace) }}' - echo '}' +env: + TEST_OUTPUT_STYLE: pretty + COMPOSER_OPTIONS: --optimize-autoloader +jobs: tests: name: UTs & FTs - PHP ${{ matrix.php-version }} runs-on: ubuntu-latest @@ -70,7 +27,7 @@ jobs: - php-version: '8.2' steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # @TODO Figure out if coverage for every version is actually useful or not # - name: Enable coverage @@ -91,7 +48,7 @@ jobs: - name: Setup cache id: cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.composer @@ -146,7 +103,7 @@ jobs: name: Static checks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP 8.2 uses: shivammathur/setup-php@v2 @@ -160,7 +117,7 @@ jobs: - name: Setup cache id: cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.composer @@ -175,7 +132,7 @@ jobs: - name: Dependencies check if: ${{ github.event_name == 'pull_request' }} - uses: actions/dependency-review-action@v1 + uses: actions/dependency-review-action@v4 nightly-tests: name: Nightly - PHP ${{ matrix.php-version }} @@ -193,7 +150,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 @@ -207,7 +164,7 @@ jobs: - name: Setup cache id: cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.composer @@ -221,56 +178,3 @@ jobs: - name: Test run: make test-unit && make test-functional - - - fetch-info: - name: Fetch triggering workflow metadata - needs: [tests, static-checks, nightly-tests] - runs-on: ubuntu-latest - permissions: - contents: read - checks: write # For the check run creation ! - steps: - - name: 'Check run ○' - uses: yoanm/temp-reports-group-workspace/gha-attach-check-run-to-triggering-workflow@improve - with: - name: 'Fetch coverage info' - fails-on-triggering-workflow-failure: true - - - uses: yoanm/temp-reports-group-workspace/gha-fetch-workflow-metadata@improve - id: fetch-workflow-metadata - outputs: - commit-sha: ${{ steps.fetch-workflow-metadata.outputs.commit-sha }} - run-id: ${{ steps.fetch-workflow-metadata.outputs.run-id }} - - codacy-uploader: - name: Codacy - needs: [ fetch-info ] - uses: yoanm/temp-reports-group-workspace/.github/workflows/codacy-upload-from-artifacts.yml@improve - permissions: - contents: read - checks: write # For the check run creation ! - secrets: - PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} - with: - artifacts-pattern: coverage-groups-* - run-id: ${{ needs.fetch-info.outputs.run-id }} - #override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it ! - - codecov-uploader: - name: Codecov - needs: [ fetch-info ] - uses: yoanm/temp-reports-group-workspace/.github/workflows/codecov-upload-from-artifacts.yml@improve - permissions: - contents: read - checks: write # For the check run creation ! - secrets: - TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - artifacts-pattern: coverage-groups-* - run-id: ${{ needs.fetch-info.outputs.run-id }} - override-commit: ${{ needs.fetch-info.outputs.commit-sha }} - override-branch: ${{ needs.fetch-info.outputs.branch }} - override-pr: ${{ needs.fetch-info.outputs.pr-number }} - override-build: ${{ needs.fetch-info.outputs.run-id }} - override-build-url: ${{ needs.fetch-info.outputs.run-url }} diff --git a/.github/workflows/reusable-coverage-upload-workflow.yml b/.github/workflows/reusable-coverage-upload-workflow.yml new file mode 100644 index 00000000..4acc9a32 --- /dev/null +++ b/.github/workflows/reusable-coverage-upload-workflow.yml @@ -0,0 +1,105 @@ +name: 'Coverage upload reusable workflow' + +on: + workflow_call: + +jobs: + fetch-info: + name: Fetch triggering workflow metadata + runs-on: ubuntu-latest + permissions: + contents: read + checks: write # For the check run creation ! + steps: + - name: 'Check run ○' + uses: yoanm/temp-reports-group-workspace/gha-attach-check-run-to-triggering-workflow@improve + with: + name: 'Fetch coverage info' + fails-on-triggering-workflow-failure: true + + - uses: yoanm/temp-reports-group-workspace/gha-fetch-workflow-metadata@improve + id: fetch-workflow-metadata + + outputs: + commit-sha: ${{ steps.fetch-workflow-metadata.outputs.commit-sha }} + run-id: ${{ steps.fetch-workflow-metadata.outputs.run-id }} + + codacy-uploader: + name: Codacy + needs: [fetch-info] + uses: yoanm/temp-reports-group-workspace/.github/workflows/codacy-upload-from-artifacts.yml@improve + permissions: + contents: read + checks: write # For the check run creation ! + secrets: + PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + with: + artifacts-pattern: coverage-groups-* + run-id: ${{ needs.fetch-info.outputs.run-id }} + #override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it ! + + codecov-uploader: + name: Codecov + needs: [fetch-info] + uses: yoanm/temp-reports-group-workspace/.github/workflows/codecov-upload-from-artifacts.yml@improve + permissions: + contents: read + checks: write # For the check run creation ! + secrets: + TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + artifacts-pattern: coverage-groups-* + run-id: ${{ needs.fetch-info.outputs.run-id }} + override-commit: ${{ needs.fetch-info.outputs.commit-sha }} + override-branch: ${{ needs.fetch-info.outputs.branch }} + override-pr: ${{ needs.fetch-info.outputs.pr-number }} + override-build: ${{ needs.fetch-info.outputs.run-id }} + override-build-url: ${{ needs.fetch-info.outputs.run-url }} + + debug-context: + name: DEBUG - context + runs-on: ubuntu-latest + steps: + - run: | + echo '{' + echo '"github.action": ${{ toJson(github.action) }},' + echo '"github.action_path": ${{ toJson(github.action_path) }},' + echo '"github.action_ref": ${{ toJson(github.action_ref) }},' + echo '"github.action_repository": ${{ toJson(github.action_repository) }},' + echo '"github.action_status": ${{ toJson(github.action_status) }},' + echo '"github.actor": ${{ toJson(github.actor) }},' + echo '"github.actor_id": ${{ toJson(github.actor_id) }},' + echo '"github.base_ref": ${{ toJson(github.base_ref) }},' + echo '"github.event": ${{ toJson(github.event) }},' + echo '"github.event_name": ${{ toJson(github.event_name) }},' + echo '"github.event_path": ${{ toJson(github.event_path) }},' + echo '"github.head_ref": ${{ toJson(github.head_ref) }},' + echo '"github.job": ${{ toJson(github.job) }},' + echo '"github.path": ${{ toJson(github.path) }},' + echo '"github.ref": ${{ toJson(github.ref) }},' + echo '"github.ref_name": ${{ toJson(github.ref_name) }},' + echo '"github.ref_protected": ${{ toJson(github.ref_protected) }},' + echo '"github.ref_type": ${{ toJson(github.ref_type) }},' + echo '"github.repository": ${{ toJson(github.repository) }},' + echo '"github.repository_id": ${{ toJson(github.repository_id) }},' + echo '"github.repository_owner": ${{ toJson(github.repository_owner) }},' + echo '"github.repository_owner_id": ${{ toJson(github.repository_owner_id) }},' + echo '"github.repositoryUrl": ${{ toJson(github.repositoryUrl) }},' + echo '"github.run_id": ${{ toJson(github.run_id) }},' + echo '"github.run_number": ${{ toJson(github.run_number) }},' + echo '"github.run_attempt": ${{ toJson(github.run_attempt) }},' + echo '"github.sha": ${{ toJson(github.sha) }},' + echo '"github.triggering_actor": ${{ toJson(github.triggering_actor) }},' + echo '"github.workflow": ${{ toJson(github.workflow) }},' + echo '"github.workflow_ref": ${{ toJson(github.workflow_ref) }},' + echo '"github.workflow_sha": ${{ toJson(github.workflow_sha) }},' + echo '"github.workspace": ${{ toJson(github.workspace) }}' + echo '}' + + debug-uploads: + name: DEBUG - Uploaders + runs-on: ubuntu-latest + needs: [ codacy-uploader, codecov-uploader ] + steps: + - run: echo 'codecov='"'"'${{ toJson(needs.codecov-uploader) }}'"'" + - run: echo 'codacy='"'"'${{ toJson(needs.codacy-uploader) }}'"'" From 7a8caee43c7ca829fa98145a21b3de033b617ffa Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:51:52 +0100 Subject: [PATCH 06/12] Fix --- .github/workflows/CI.yml | 172 +-------------------- .github/workflows/coverage-upload.yml | 99 +----------- .github/workflows/pre-check-CI-updates.yml | 12 +- .github/workflows/reusable-CI-workflow.yml | 4 +- 4 files changed, 15 insertions(+), 272 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b1365edd..592b4805 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -28,171 +28,7 @@ env: jobs: tests: - name: UTs & FTs - PHP ${{ matrix.php-version }} - runs-on: ubuntu-latest - env: - COVERAGE_TYPE: xdebug - COVERAGE_OUTPUT_STYLE: clover - strategy: - fail-fast: true - max-parallel: 4 - matrix: - include: - # Bare minimum => Lowest versions allowed by composer config - - php-version: '8.0' - composer-flag: --prefer-lowest - # Up-to-date versions => Latest versions allowed by composer config - - php-version: '8.2' - steps: - - name: Check out code - uses: actions/checkout@v4 - -# @TODO Figure out if coverage for every version is actually useful or not -# - name: Enable coverage -# if: ${{ matrix.php-version == '8.2' }} -# run: | -# echo "COVERAGE_OUTPUT_STYLE=clover" >> $GITHUB_ENV -# echo "COVERAGE_TYPE=xdebug" >> $GITHUB_ENV - - - name: Setup PHP ${{ matrix.php-version }} - uses: shivammathur/setup-php@v2 - env: - update: true # Always use latest available patch for the version - fail-fast: true # step will fail if an extension or tool fails to set up - with: - php-version: '${{ matrix.php-version }}' - tools: composer - coverage: ${{ env.COVERAGE_TYPE }} - - - name: Setup cache - id: cache - uses: actions/cache@v4 - with: - path: | - ~/.composer - ./vendor - # Clear the cache if composer json (as composer.lock is in the repo) has been updated - key: tests-${{ matrix.php-version }}-${{ matrix.composer-flag }}-${{ hashFiles('composer.json') }} - - - name: Build - run: | - make build - - - name: Tests - run: make test-unit && make test-functional - - - name: Create "unit tests" reports directory - if: ${{ env.COVERAGE_TYPE == 'xdebug' }} - id: unit-tests-coverage-group - uses: yoanm/temp-reports-group-workspace/gha-create@improve - with: - name: unit-tests - format: clover - files: build/coverage-phpunit/unit.clover - flags: | - unit-tests - php-${{ matrix.php-version }} - path: build/coverage-groups - - - name: Create "functional tests" coverage group - if: ${{ env.COVERAGE_TYPE == 'xdebug' }} - id: functional-tests-coverage-group - uses: yoanm/temp-reports-group-workspace/gha-create@improve - with: - name: functional-tests - format: clover - files: | - build/coverage-phpunit/functional.clover - build/coverage-behat/clover.xml - flags: | - functional-tests - php-${{ matrix.php-version }} - path: build/coverage-groups - - - name: Upload coverage reports - if: ${{ env.COVERAGE_TYPE == 'xdebug' }} - uses: actions/upload-artifact@v4 - with: - name: coverage-groups-php${{ matrix.php-version }} - path: build/coverage-groups - if-no-files-found: error - - static-checks: - name: Static checks - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup PHP 8.2 - uses: shivammathur/setup-php@v2 - with: - php-version: 8.2 # Latest supported - tools: composer - coverage: none - env: - # Always use latest available patch for the version - update: true - - - name: Setup cache - id: cache - uses: actions/cache@v4 - with: - path: | - ~/.composer - # Clear the cache if composer json (as composer.lock is in the repo) has been updated - key: tests-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }} - - - name: Build - run: make build - - - name: ComposerRequireChecker - uses: docker://webfactory/composer-require-checker:4.5.0 - - - name: Dependencies check - if: ${{ github.event_name == 'pull_request' }} - uses: actions/dependency-review-action@v4 - - nightly-tests: - name: Nightly - PHP ${{ matrix.php-version }} - runs-on: ubuntu-latest - env: - COMPOSER_OPTIONS: '--optimize-autoloader --ignore-platform-req=php+' - continue-on-error: true - needs: [ static-checks, tests ] - strategy: - fail-fast: false - max-parallel: 4 - matrix: - php-version: - - '8.3' # Current php dev version - - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Setup PHP ${{ matrix.php-version }} - uses: shivammathur/setup-php@v2 - with: - php-version: '${{ matrix.php-version }}' - tools: composer - coverage: none - env: - # Always use latest available patch for the version - update: true - - - name: Setup cache - id: cache - uses: actions/cache@v4 - with: - path: | - ~/.composer - ./vendor - # Clear the cache if composer json (as composer.lock is in the repo) has been updated - key: tests-${{ matrix.php-version }}-${{ hashFiles('composer.json') }} - - - name: Build - run: | - make build - - - name: Test - run: make test-unit && make test-functional + name: Tests + permissions: + contents: read + uses: ./.github/workflows/reusable-CI-workflow.yml diff --git a/.github/workflows/coverage-upload.yml b/.github/workflows/coverage-upload.yml index 3654fcf8..4e291a68 100644 --- a/.github/workflows/coverage-upload.yml +++ b/.github/workflows/coverage-upload.yml @@ -5,102 +5,9 @@ on: types: [completed] jobs: - fetch-info: - name: Fetch triggering workflow metadata - runs-on: ubuntu-latest + upload: + name: Upload permissions: contents: read checks: write # For the check run creation ! - steps: - - name: 'Check run ○' - uses: yoanm/temp-reports-group-workspace/gha-attach-check-run-to-triggering-workflow@improve - with: - name: 'Fetch coverage info' - fails-on-triggering-workflow-failure: true - - - uses: yoanm/temp-reports-group-workspace/gha-fetch-workflow-metadata@improve - id: fetch-workflow-metadata - - outputs: - commit-sha: ${{ steps.fetch-workflow-metadata.outputs.commit-sha }} - run-id: ${{ steps.fetch-workflow-metadata.outputs.run-id }} - - codacy-uploader: - name: Codacy - needs: [fetch-info] - uses: yoanm/temp-reports-group-workspace/.github/workflows/codacy-upload-from-artifacts.yml@improve - permissions: - contents: read - checks: write # For the check run creation ! - secrets: - PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} - with: - artifacts-pattern: coverage-groups-* - run-id: ${{ needs.fetch-info.outputs.run-id }} - #override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it ! - - codecov-uploader: - name: Codecov - needs: [fetch-info] - uses: yoanm/temp-reports-group-workspace/.github/workflows/codecov-upload-from-artifacts.yml@improve - permissions: - contents: read - checks: write # For the check run creation ! - secrets: - TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - artifacts-pattern: coverage-groups-* - run-id: ${{ needs.fetch-info.outputs.run-id }} - override-commit: ${{ needs.fetch-info.outputs.commit-sha }} - override-branch: ${{ needs.fetch-info.outputs.branch }} - override-pr: ${{ needs.fetch-info.outputs.pr-number }} - override-build: ${{ needs.fetch-info.outputs.run-id }} - override-build-url: ${{ needs.fetch-info.outputs.run-url }} - - debug-context: - name: DEBUG - context - runs-on: ubuntu-latest - steps: - - run: | - echo '{' - echo '"github.action": ${{ toJson(github.action) }},' - echo '"github.action_path": ${{ toJson(github.action_path) }},' - echo '"github.action_ref": ${{ toJson(github.action_ref) }},' - echo '"github.action_repository": ${{ toJson(github.action_repository) }},' - echo '"github.action_status": ${{ toJson(github.action_status) }},' - echo '"github.actor": ${{ toJson(github.actor) }},' - echo '"github.actor_id": ${{ toJson(github.actor_id) }},' - echo '"github.base_ref": ${{ toJson(github.base_ref) }},' - echo '"github.event": ${{ toJson(github.event) }},' - echo '"github.event_name": ${{ toJson(github.event_name) }},' - echo '"github.event_path": ${{ toJson(github.event_path) }},' - echo '"github.head_ref": ${{ toJson(github.head_ref) }},' - echo '"github.job": ${{ toJson(github.job) }},' - echo '"github.path": ${{ toJson(github.path) }},' - echo '"github.ref": ${{ toJson(github.ref) }},' - echo '"github.ref_name": ${{ toJson(github.ref_name) }},' - echo '"github.ref_protected": ${{ toJson(github.ref_protected) }},' - echo '"github.ref_type": ${{ toJson(github.ref_type) }},' - echo '"github.repository": ${{ toJson(github.repository) }},' - echo '"github.repository_id": ${{ toJson(github.repository_id) }},' - echo '"github.repository_owner": ${{ toJson(github.repository_owner) }},' - echo '"github.repository_owner_id": ${{ toJson(github.repository_owner_id) }},' - echo '"github.repositoryUrl": ${{ toJson(github.repositoryUrl) }},' - echo '"github.run_id": ${{ toJson(github.run_id) }},' - echo '"github.run_number": ${{ toJson(github.run_number) }},' - echo '"github.run_attempt": ${{ toJson(github.run_attempt) }},' - echo '"github.sha": ${{ toJson(github.sha) }},' - echo '"github.triggering_actor": ${{ toJson(github.triggering_actor) }},' - echo '"github.workflow": ${{ toJson(github.workflow) }},' - echo '"github.workflow_ref": ${{ toJson(github.workflow_ref) }},' - echo '"github.workflow_sha": ${{ toJson(github.workflow_sha) }},' - echo '"github.workspace": ${{ toJson(github.workspace) }}' - echo '}' - - debug-uploads: - name: DEBUG - Uploaders - runs-on: ubuntu-latest - needs: [ codacy-uploader, codecov-uploader ] - steps: - - run: echo 'codecov='"'"'${{ toJson(needs.codecov-uploader) }}'"'" - - run: echo 'codacy='"'"'${{ toJson(needs.codacy-uploader) }}'"'" + uses: ./.github/workflows/reusable-coverage-upload-workflow.yml diff --git a/.github/workflows/pre-check-CI-updates.yml b/.github/workflows/pre-check-CI-updates.yml index 25e879f9..5d493759 100644 --- a/.github/workflows/pre-check-CI-updates.yml +++ b/.github/workflows/pre-check-CI-updates.yml @@ -1,10 +1,10 @@ name: 'Test CI updates' -description: | - As CI workflow relies on `workflow_run` trigger for upload, this workflow is used in order to ease updates made on - CI workflow (or linked workflows/actions). It's kind of pre-check to ensure once updates are merged on main branch, - the `workflow_run` workflow execution will behave as expected. +# [DESCRIPTION] +# As CI workflow relies on `workflow_run` trigger for upload, this workflow is used in order to ease updates made on +# CI workflow (or linked workflows/actions). It's kind of pre-check to ensure once updates are merged on main branch, +# the `workflow_run` workflow execution will behave as expected. -on: # Build any PRs and main branch changes +on: pull_request: types: - opened @@ -17,7 +17,6 @@ on: # Build any PRs and main branch changes - '.github/workflows/reusable-CI-workflow.yml' - '.github/workflows/reusable-coverage-upload-workflow.yml' - concurrency: group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}" cancel-in-progress: true @@ -31,6 +30,7 @@ jobs: upload: name: Upload + needs: [tests] permissions: contents: read checks: write # For the check run creation ! diff --git a/.github/workflows/reusable-CI-workflow.yml b/.github/workflows/reusable-CI-workflow.yml index 1f40fb29..cbc7d372 100644 --- a/.github/workflows/reusable-CI-workflow.yml +++ b/.github/workflows/reusable-CI-workflow.yml @@ -10,7 +10,7 @@ env: jobs: tests: - name: UTs & FTs - PHP ${{ matrix.php-version }} + name: PHP ${{ matrix.php-version }} runs-on: ubuntu-latest env: COVERAGE_TYPE: xdebug @@ -100,7 +100,7 @@ jobs: if-no-files-found: error static-checks: - name: Static checks + name: Static analysis runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 3eb1e1e915cb19d75bf37af195aeead374b714ad Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 11:05:30 +0100 Subject: [PATCH 07/12] Forward secrets --- .github/workflows/coverage-upload.yml | 3 +++ .github/workflows/pre-check-CI-updates.yml | 3 +++ .github/workflows/reusable-coverage-upload-workflow.yml | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/.github/workflows/coverage-upload.yml b/.github/workflows/coverage-upload.yml index 4e291a68..f924d242 100644 --- a/.github/workflows/coverage-upload.yml +++ b/.github/workflows/coverage-upload.yml @@ -10,4 +10,7 @@ jobs: permissions: contents: read checks: write # For the check run creation ! + secrets: + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} uses: ./.github/workflows/reusable-coverage-upload-workflow.yml diff --git a/.github/workflows/pre-check-CI-updates.yml b/.github/workflows/pre-check-CI-updates.yml index 5d493759..701bf0cb 100644 --- a/.github/workflows/pre-check-CI-updates.yml +++ b/.github/workflows/pre-check-CI-updates.yml @@ -34,4 +34,7 @@ jobs: permissions: contents: read checks: write # For the check run creation ! + secrets: + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} uses: ./.github/workflows/reusable-coverage-upload-workflow.yml diff --git a/.github/workflows/reusable-coverage-upload-workflow.yml b/.github/workflows/reusable-coverage-upload-workflow.yml index 4acc9a32..0a6f7165 100644 --- a/.github/workflows/reusable-coverage-upload-workflow.yml +++ b/.github/workflows/reusable-coverage-upload-workflow.yml @@ -2,6 +2,11 @@ name: 'Coverage upload reusable workflow' on: workflow_call: + secrets: + CODACY_PROJECT_TOKEN: + required: true + CODECOV_TOKEN: + required: true jobs: fetch-info: From 2f2632386f6324a3790b27fb3cf805ea673f2207 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 11:22:46 +0100 Subject: [PATCH 08/12] Improve --- .github/workflows/CI.yml | 5 +++-- .github/workflows/coverage-upload.yml | 2 +- .github/workflows/reusable-coverage-upload-workflow.yml | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 592b4805..dfaa0eb2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,8 +7,9 @@ on: # Build any PRs and main branch changes - opened - synchronize paths-ignore: - # In case of updates to those workflows, they must be pre-check by pre-check-CI-updates.yml instead ! - - '.github/workflows/pre-check-CI-updates.yml' # This workflow + # In case of updates to those workflows, they must be pre-checked by `pre-check-CI-updates.yml` rather than this workflow ! + # Any updates on those workflows are expected to be restricted to those workflows only ! (no update on code for instance) + - '.github/workflows/pre-check-CI-updates.yml' - '.github/workflows/CI.yml' - '.github/workflows/coverage-upload.yml' - '.github/workflows/reusable-CI-workflow.yml' diff --git a/.github/workflows/coverage-upload.yml b/.github/workflows/coverage-upload.yml index f924d242..9428e0d1 100644 --- a/.github/workflows/coverage-upload.yml +++ b/.github/workflows/coverage-upload.yml @@ -1,4 +1,4 @@ -name: 'Coverage upload' +name: 'Coverage' on: workflow_run: workflows: ["CI"] diff --git a/.github/workflows/reusable-coverage-upload-workflow.yml b/.github/workflows/reusable-coverage-upload-workflow.yml index 0a6f7165..414fd18f 100644 --- a/.github/workflows/reusable-coverage-upload-workflow.yml +++ b/.github/workflows/reusable-coverage-upload-workflow.yml @@ -39,6 +39,7 @@ jobs: secrets: PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} with: + job-name: "Codacy" artifacts-pattern: coverage-groups-* run-id: ${{ needs.fetch-info.outputs.run-id }} #override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it ! @@ -53,6 +54,7 @@ jobs: secrets: TOKEN: ${{ secrets.CODECOV_TOKEN }} with: + job-name: "Codecov" artifacts-pattern: coverage-groups-* run-id: ${{ needs.fetch-info.outputs.run-id }} override-commit: ${{ needs.fetch-info.outputs.commit-sha }} From 4afef02651f3f5f7d2098e70921916a45a4afa9f Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 11:24:32 +0100 Subject: [PATCH 09/12] Fix --- .github/workflows/reusable-coverage-upload-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-coverage-upload-workflow.yml b/.github/workflows/reusable-coverage-upload-workflow.yml index 414fd18f..bf8bf495 100644 --- a/.github/workflows/reusable-coverage-upload-workflow.yml +++ b/.github/workflows/reusable-coverage-upload-workflow.yml @@ -39,9 +39,9 @@ jobs: secrets: PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} with: - job-name: "Codacy" artifacts-pattern: coverage-groups-* run-id: ${{ needs.fetch-info.outputs.run-id }} + override-job-name: "Codacy" #override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it ! codecov-uploader: @@ -54,9 +54,9 @@ jobs: secrets: TOKEN: ${{ secrets.CODECOV_TOKEN }} with: - job-name: "Codecov" artifacts-pattern: coverage-groups-* run-id: ${{ needs.fetch-info.outputs.run-id }} + override-job-name: "Codecov" override-commit: ${{ needs.fetch-info.outputs.commit-sha }} override-branch: ${{ needs.fetch-info.outputs.branch }} override-pr: ${{ needs.fetch-info.outputs.pr-number }} From 7d28cf6be12005b75ad436f25e8ab57762e58108 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 11:26:19 +0100 Subject: [PATCH 10/12] Trigger CI From 5d01a545aee22352fe01f1947f45ad0846b6ae59 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 11:31:45 +0100 Subject: [PATCH 11/12] Improve --- .github/workflows/reusable-coverage-upload-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-coverage-upload-workflow.yml b/.github/workflows/reusable-coverage-upload-workflow.yml index bf8bf495..16a45482 100644 --- a/.github/workflows/reusable-coverage-upload-workflow.yml +++ b/.github/workflows/reusable-coverage-upload-workflow.yml @@ -41,7 +41,7 @@ jobs: with: artifacts-pattern: coverage-groups-* run-id: ${{ needs.fetch-info.outputs.run-id }} - override-job-name: "Codacy" + override-job-name: "Codacy title" #override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it ! codecov-uploader: @@ -56,7 +56,7 @@ jobs: with: artifacts-pattern: coverage-groups-* run-id: ${{ needs.fetch-info.outputs.run-id }} - override-job-name: "Codecov" + override-job-name: "Codecov title" override-commit: ${{ needs.fetch-info.outputs.commit-sha }} override-branch: ${{ needs.fetch-info.outputs.branch }} override-pr: ${{ needs.fetch-info.outputs.pr-number }} From 6f5513945dc66c456e2c5d948619c13ff8d997d6 Mon Sep 17 00:00:00 2001 From: Yoanm <4410697+yoanm@users.noreply.github.com> Date: Sat, 30 Mar 2024 12:25:33 +0100 Subject: [PATCH 12/12] Improve --- .../reusable-coverage-upload-workflow.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reusable-coverage-upload-workflow.yml b/.github/workflows/reusable-coverage-upload-workflow.yml index 16a45482..8476349d 100644 --- a/.github/workflows/reusable-coverage-upload-workflow.yml +++ b/.github/workflows/reusable-coverage-upload-workflow.yml @@ -42,7 +42,10 @@ jobs: artifacts-pattern: coverage-groups-* run-id: ${{ needs.fetch-info.outputs.run-id }} override-job-name: "Codacy title" - #override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it ! + force-git-commit: ${{ needs.fetch-info.outputs.commit-sha }} + # force-uploader-language: ... + # force-uploader-coverage-parser: ... + # force-uploader-cli-version: ... codecov-uploader: name: Codecov @@ -57,11 +60,11 @@ jobs: artifacts-pattern: coverage-groups-* run-id: ${{ needs.fetch-info.outputs.run-id }} override-job-name: "Codecov title" - override-commit: ${{ needs.fetch-info.outputs.commit-sha }} - override-branch: ${{ needs.fetch-info.outputs.branch }} - override-pr: ${{ needs.fetch-info.outputs.pr-number }} - override-build: ${{ needs.fetch-info.outputs.run-id }} - override-build-url: ${{ needs.fetch-info.outputs.run-url }} + force-git-commit: ${{ needs.fetch-info.outputs.commit-sha }} + force-git-branch: ${{ needs.fetch-info.outputs.branch }} + force-gh-pr: ${{ needs.fetch-info.outputs.pr-number }} + force-uploader-build: ${{ needs.fetch-info.outputs.run-id }} + force-uploader-build-url: ${{ needs.fetch-info.outputs.run-url }} debug-context: name: DEBUG - context