Skip to content

Commit 3a6561a

Browse files
committed
Fix
1 parent a5de417 commit 3a6561a

File tree

3 files changed

+8
-266
lines changed

3 files changed

+8
-266
lines changed

.github/workflows/CI.yml

Lines changed: 4 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -28,171 +28,7 @@ env:
2828

2929
jobs:
3030
tests:
31-
name: UTs & FTs - PHP ${{ matrix.php-version }}
32-
runs-on: ubuntu-latest
33-
env:
34-
COVERAGE_TYPE: xdebug
35-
COVERAGE_OUTPUT_STYLE: clover
36-
strategy:
37-
fail-fast: true
38-
max-parallel: 4
39-
matrix:
40-
include:
41-
# Bare minimum => Lowest versions allowed by composer config
42-
- php-version: '8.0'
43-
composer-flag: --prefer-lowest
44-
# Up-to-date versions => Latest versions allowed by composer config
45-
- php-version: '8.2'
46-
steps:
47-
- name: Check out code
48-
uses: actions/checkout@v4
49-
50-
# @TODO Figure out if coverage for every version is actually useful or not
51-
# - name: Enable coverage
52-
# if: ${{ matrix.php-version == '8.2' }}
53-
# run: |
54-
# echo "COVERAGE_OUTPUT_STYLE=clover" >> $GITHUB_ENV
55-
# echo "COVERAGE_TYPE=xdebug" >> $GITHUB_ENV
56-
57-
- name: Setup PHP ${{ matrix.php-version }}
58-
uses: shivammathur/setup-php@v2
59-
env:
60-
update: true # Always use latest available patch for the version
61-
fail-fast: true # step will fail if an extension or tool fails to set up
62-
with:
63-
php-version: '${{ matrix.php-version }}'
64-
tools: composer
65-
coverage: ${{ env.COVERAGE_TYPE }}
66-
67-
- name: Setup cache
68-
id: cache
69-
uses: actions/cache@v4
70-
with:
71-
path: |
72-
~/.composer
73-
./vendor
74-
# Clear the cache if composer json (as composer.lock is in the repo) has been updated
75-
key: tests-${{ matrix.php-version }}-${{ matrix.composer-flag }}-${{ hashFiles('composer.json') }}
76-
77-
- name: Build
78-
run: |
79-
make build
80-
81-
- name: Tests
82-
run: make test-unit && make test-functional
83-
84-
- name: Create "unit tests" reports directory
85-
if: ${{ env.COVERAGE_TYPE == 'xdebug' }}
86-
id: unit-tests-coverage-group
87-
uses: yoanm/temp-reports-group-workspace/gha-create@improve
88-
with:
89-
name: unit-tests
90-
format: clover
91-
files: build/coverage-phpunit/unit.clover
92-
flags: |
93-
unit-tests
94-
php-${{ matrix.php-version }}
95-
path: build/coverage-groups
96-
97-
- name: Create "functional tests" coverage group
98-
if: ${{ env.COVERAGE_TYPE == 'xdebug' }}
99-
id: functional-tests-coverage-group
100-
uses: yoanm/temp-reports-group-workspace/gha-create@improve
101-
with:
102-
name: functional-tests
103-
format: clover
104-
files: |
105-
build/coverage-phpunit/functional.clover
106-
build/coverage-behat/clover.xml
107-
flags: |
108-
functional-tests
109-
php-${{ matrix.php-version }}
110-
path: build/coverage-groups
111-
112-
- name: Upload coverage reports
113-
if: ${{ env.COVERAGE_TYPE == 'xdebug' }}
114-
uses: actions/upload-artifact@v4
115-
with:
116-
name: coverage-groups-php${{ matrix.php-version }}
117-
path: build/coverage-groups
118-
if-no-files-found: error
119-
120-
static-checks:
121-
name: Static checks
122-
runs-on: ubuntu-latest
123-
steps:
124-
- uses: actions/checkout@v4
125-
126-
- name: Setup PHP 8.2
127-
uses: shivammathur/setup-php@v2
128-
with:
129-
php-version: 8.2 # Latest supported
130-
tools: composer
131-
coverage: none
132-
env:
133-
# Always use latest available patch for the version
134-
update: true
135-
136-
- name: Setup cache
137-
id: cache
138-
uses: actions/cache@v4
139-
with:
140-
path: |
141-
~/.composer
142-
# Clear the cache if composer json (as composer.lock is in the repo) has been updated
143-
key: tests-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }}
144-
145-
- name: Build
146-
run: make build
147-
148-
- name: ComposerRequireChecker
149-
uses: docker://webfactory/composer-require-checker:4.5.0
150-
151-
- name: Dependencies check
152-
if: ${{ github.event_name == 'pull_request' }}
153-
uses: actions/dependency-review-action@v4
154-
155-
nightly-tests:
156-
name: Nightly - PHP ${{ matrix.php-version }}
157-
runs-on: ubuntu-latest
158-
env:
159-
COMPOSER_OPTIONS: '--optimize-autoloader --ignore-platform-req=php+'
160-
continue-on-error: true
161-
needs: [ static-checks, tests ]
162-
strategy:
163-
fail-fast: false
164-
max-parallel: 4
165-
matrix:
166-
php-version:
167-
- '8.3' # Current php dev version
168-
169-
steps:
170-
- name: Check out code
171-
uses: actions/checkout@v4
172-
173-
- name: Setup PHP ${{ matrix.php-version }}
174-
uses: shivammathur/setup-php@v2
175-
with:
176-
php-version: '${{ matrix.php-version }}'
177-
tools: composer
178-
coverage: none
179-
env:
180-
# Always use latest available patch for the version
181-
update: true
182-
183-
- name: Setup cache
184-
id: cache
185-
uses: actions/cache@v4
186-
with:
187-
path: |
188-
~/.composer
189-
./vendor
190-
# Clear the cache if composer json (as composer.lock is in the repo) has been updated
191-
key: tests-${{ matrix.php-version }}-${{ hashFiles('composer.json') }}
192-
193-
- name: Build
194-
run: |
195-
make build
196-
197-
- name: Test
198-
run: make test-unit && make test-functional
31+
name: Tests
32+
permissions:
33+
contents: read
34+
uses: ./.github/workflows/reusable-CI-workflow.yml

.github/workflows/coverage-upload.yml

Lines changed: 3 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -5,102 +5,9 @@ on:
55
types: [completed]
66

77
jobs:
8-
fetch-info:
9-
name: Fetch triggering workflow metadata
10-
runs-on: ubuntu-latest
8+
upload:
9+
name: Upload
1110
permissions:
1211
contents: read
1312
checks: write # For the check run creation !
14-
steps:
15-
- name: 'Check run ○'
16-
uses: yoanm/temp-reports-group-workspace/gha-attach-check-run-to-triggering-workflow@improve
17-
with:
18-
name: 'Fetch coverage info'
19-
fails-on-triggering-workflow-failure: true
20-
21-
- uses: yoanm/temp-reports-group-workspace/gha-fetch-workflow-metadata@improve
22-
id: fetch-workflow-metadata
23-
24-
outputs:
25-
commit-sha: ${{ steps.fetch-workflow-metadata.outputs.commit-sha }}
26-
run-id: ${{ steps.fetch-workflow-metadata.outputs.run-id }}
27-
28-
codacy-uploader:
29-
name: Codacy
30-
needs: [fetch-info]
31-
uses: yoanm/temp-reports-group-workspace/.github/workflows/codacy-upload-from-artifacts.yml@improve
32-
permissions:
33-
contents: read
34-
checks: write # For the check run creation !
35-
secrets:
36-
PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
37-
with:
38-
artifacts-pattern: coverage-groups-*
39-
run-id: ${{ needs.fetch-info.outputs.run-id }}
40-
#override-commit: ${{ needs.fetch-info.outputs.commit-sha }} # Uploader action doesn't support it !
41-
42-
codecov-uploader:
43-
name: Codecov
44-
needs: [fetch-info]
45-
uses: yoanm/temp-reports-group-workspace/.github/workflows/codecov-upload-from-artifacts.yml@improve
46-
permissions:
47-
contents: read
48-
checks: write # For the check run creation !
49-
secrets:
50-
TOKEN: ${{ secrets.CODECOV_TOKEN }}
51-
with:
52-
artifacts-pattern: coverage-groups-*
53-
run-id: ${{ needs.fetch-info.outputs.run-id }}
54-
override-commit: ${{ needs.fetch-info.outputs.commit-sha }}
55-
override-branch: ${{ needs.fetch-info.outputs.branch }}
56-
override-pr: ${{ needs.fetch-info.outputs.pr-number }}
57-
override-build: ${{ needs.fetch-info.outputs.run-id }}
58-
override-build-url: ${{ needs.fetch-info.outputs.run-url }}
59-
60-
debug-context:
61-
name: DEBUG - context
62-
runs-on: ubuntu-latest
63-
steps:
64-
- run: |
65-
echo '{'
66-
echo '"github.action": ${{ toJson(github.action) }},'
67-
echo '"github.action_path": ${{ toJson(github.action_path) }},'
68-
echo '"github.action_ref": ${{ toJson(github.action_ref) }},'
69-
echo '"github.action_repository": ${{ toJson(github.action_repository) }},'
70-
echo '"github.action_status": ${{ toJson(github.action_status) }},'
71-
echo '"github.actor": ${{ toJson(github.actor) }},'
72-
echo '"github.actor_id": ${{ toJson(github.actor_id) }},'
73-
echo '"github.base_ref": ${{ toJson(github.base_ref) }},'
74-
echo '"github.event": ${{ toJson(github.event) }},'
75-
echo '"github.event_name": ${{ toJson(github.event_name) }},'
76-
echo '"github.event_path": ${{ toJson(github.event_path) }},'
77-
echo '"github.head_ref": ${{ toJson(github.head_ref) }},'
78-
echo '"github.job": ${{ toJson(github.job) }},'
79-
echo '"github.path": ${{ toJson(github.path) }},'
80-
echo '"github.ref": ${{ toJson(github.ref) }},'
81-
echo '"github.ref_name": ${{ toJson(github.ref_name) }},'
82-
echo '"github.ref_protected": ${{ toJson(github.ref_protected) }},'
83-
echo '"github.ref_type": ${{ toJson(github.ref_type) }},'
84-
echo '"github.repository": ${{ toJson(github.repository) }},'
85-
echo '"github.repository_id": ${{ toJson(github.repository_id) }},'
86-
echo '"github.repository_owner": ${{ toJson(github.repository_owner) }},'
87-
echo '"github.repository_owner_id": ${{ toJson(github.repository_owner_id) }},'
88-
echo '"github.repositoryUrl": ${{ toJson(github.repositoryUrl) }},'
89-
echo '"github.run_id": ${{ toJson(github.run_id) }},'
90-
echo '"github.run_number": ${{ toJson(github.run_number) }},'
91-
echo '"github.run_attempt": ${{ toJson(github.run_attempt) }},'
92-
echo '"github.sha": ${{ toJson(github.sha) }},'
93-
echo '"github.triggering_actor": ${{ toJson(github.triggering_actor) }},'
94-
echo '"github.workflow": ${{ toJson(github.workflow) }},'
95-
echo '"github.workflow_ref": ${{ toJson(github.workflow_ref) }},'
96-
echo '"github.workflow_sha": ${{ toJson(github.workflow_sha) }},'
97-
echo '"github.workspace": ${{ toJson(github.workspace) }}'
98-
echo '}'
99-
100-
debug-uploads:
101-
name: DEBUG - Uploaders
102-
runs-on: ubuntu-latest
103-
needs: [ codacy-uploader, codecov-uploader ]
104-
steps:
105-
- run: echo 'codecov='"'"'${{ toJson(needs.codecov-uploader) }}'"'"
106-
- run: echo 'codacy='"'"'${{ toJson(needs.codacy-uploader) }}'"'"
13+
uses: ./.github/workflows/reusable-coverage-upload-workflow.yml

.github/workflows/pre-check-CI-updates.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: |
44
CI workflow (or linked workflows/actions). It's kind of pre-check to ensure once updates are merged on main branch,
55
the `workflow_run` workflow execution will behave as expected.
66
7-
on: # Build any PRs and main branch changes
7+
on:
88
pull_request:
99
types:
1010
- opened
@@ -17,7 +17,6 @@ on: # Build any PRs and main branch changes
1717
- '.github/workflows/reusable-CI-workflow.yml'
1818
- '.github/workflows/reusable-coverage-upload-workflow.yml'
1919

20-
2120
concurrency:
2221
group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}"
2322
cancel-in-progress: true

0 commit comments

Comments
 (0)