-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: general restructure #7407
Merged
Merged
CI: general restructure #7407
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
e9e9a2d
build.sh - same shell flags as everywhere else
keradus 361ff95
extract composite actions
keradus f49a1c8
no need to specify fetch-depth
keradus c8fb47b
move execute-deployment to separated job
keradus b0700a1
automate decisions to run extra fixer calls
keradus e7231d9
CS
keradus 38b067a
fix
keradus 397af8d
move auto-review to SCA
keradus 44a5ed7
update job name
keradus b2db833
Revert "update job name"
keradus 7a39aca
Update .github/workflows/sca.yml
keradus 67e2db9
fix flags after changes on master
keradus b0f4f89
Merge branch 'ci' of github.com:keradus/PHP-CS-Fixer into ci
keradus 7ae5a2b
Autoreview extracted
keradus b15502a
further cleanup on auto-review and tests suites
keradus 3743bd1
Update .github/composite-actions/install-composer-deps/action.yml
keradus e672d9f
CS
keradus 4adfbc8
Merge branch 'ci' of github.com:keradus/PHP-CS-Fixer into ci
keradus f944f63
fix FAST_LINT_TEST_CASES var
keradus fc0c6e0
nested compose action
keradus 81b1873
code-coverage collected
keradus e1f40ce
CS
keradus 004257a
divide test:all further
keradus 36fe205
composer normalize
keradus 05688d3
drop outdated flag
keradus c6b7fac
NO-CACHE check job after cache-purge on repo
keradus 07024c3
kick CI
keradus 2db6d19
even longer composer-cache key, as we not always have lock files
keradus 8a0dcd6
kick CI
keradus 8e3f42d
kick CI 2
keradus a34a0cf
Update .github/workflows/sca.yml
keradus 576dd87
----- MARKER -----
keradus 5b3b02c
delete setup-cache, as NOT working anyway, and we have different need…
keradus File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
.github/composite-actions/install-composer-deps/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "Install composer deps" | ||
|
||
inputs: | ||
flags: | ||
description: 'Composer flags' | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install dependencies | ||
uses: nick-invision/retry@v2 | ||
with: | ||
timeout_minutes: 5 | ||
max_attempts: 5 | ||
retry_wait_seconds: 30 | ||
# `--no-scripts` to avoid side-effects (e.g. installing dev-tools for all jobs on CI level), | ||
# all executed scripts should be explicit and run only when needed. | ||
command: composer update --optimize-autoloader --no-interaction --no-progress --no-scripts ${{ inputs.flags }} | ||
|
||
- name: Report versions | ||
shell: bash | ||
run: composer info -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Setup Cache" | ||
|
||
inputs: | ||
os: | ||
description: 'OS version' | ||
required: true | ||
php: | ||
description: 'PHP version' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get Composer cache directory | ||
id: composer-cache-dir | ||
shell: bash | ||
run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache-dir.outputs.dir }} | ||
key: composer-${{ inputs.os }}-${{ inputs.php }}-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
composer-${{ inputs.os }}-${{ inputs.php }}-${{ hashFiles('**/composer.json') }}- | ||
composer-${{ inputs.os }}-${{ inputs.php }}- | ||
composer-${{ inputs.os }}- | ||
composer- |
63 changes: 63 additions & 0 deletions
63
.github/composite-actions/setup-php-with-composer-deps/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: "Setup PHP with Composer deps" | ||
|
||
inputs: | ||
os: | ||
description: 'OS version' | ||
required: true | ||
php: | ||
description: 'PHP version' | ||
required: true | ||
php-coverage: | ||
description: 'Enable coverage driver' | ||
required: false | ||
default: 'no' | ||
tools: | ||
description: 'tools' | ||
required: false | ||
default: 'none' | ||
composer-flags: | ||
description: 'Composer flags' | ||
required: false | ||
composer-flex-with-symfony-version: | ||
description: 'Sf version to determine with Flex' | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Resolve PHP tools flag | ||
uses: actions/github-script@v6 | ||
id: setup-php-resolve-tools | ||
with: | ||
script: 'return "${{ inputs.composer-flex-with-symfony-version }}" ? "flex" : "none"' | ||
result-encoding: string | ||
|
||
- name: Resolve PHP coverage flag | ||
uses: actions/github-script@v6 | ||
id: setup-php-resolve-coverage | ||
with: | ||
script: 'return "${{ inputs.php-coverage }}" == "yes" ? "pcov" : "none"' | ||
result-encoding: string | ||
|
||
- name: Setup PHP | ||
uses: ./.github/composite-actions/setup-php | ||
with: | ||
version: ${{ inputs.php }} | ||
coverage: ${{ steps.setup-php-resolve-coverage.outputs.result }} | ||
tools: ${{ steps.setup-php-resolve-tools.outputs.result }}, ${{ inputs.tools }} | ||
|
||
- name: Configure Symfony Flex | ||
if: inputs.composer-flex-with-symfony-version | ||
shell: bash | ||
run: composer config extra.symfony.require ${{ inputs.composer-flex-with-symfony-version }} | ||
|
||
- name: Setup cache | ||
uses: ./.github/composite-actions/setup-cache | ||
with: | ||
php: ${{ inputs.php }} | ||
os: ${{ inputs.os }} | ||
|
||
- name: Install Composer deps | ||
uses: ./.github/composite-actions/install-composer-deps | ||
with: | ||
flags: ${{ inputs.composer-flags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: "Setup PHP" | ||
|
||
inputs: | ||
version: | ||
description: 'PHP version' | ||
required: true | ||
coverage: | ||
description: 'coverage mode' | ||
required: false | ||
default: 'none' | ||
tools: | ||
description: 'tools' | ||
required: false | ||
default: 'none' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.version }} | ||
coverage: ${{ inputs.coverage }} | ||
tools: composer, ${{ inputs.tools }} | ||
extensions: none, curl, dom, json, mbstring, opcache, openssl, simplexml, tokenizer, xml, xmlwriter, zip | ||
Wirone marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so...
we are getting this error (only on the PR, i do not see it on master branch)
https://github.com/keradus/PHP-CS-Fixer/actions/runs/6748717442/job/18347647031#step:31:3
I think the cache is not stored (or maybe we need to have this config in master already?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, it should store even without merge
ref https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/actions/runs/6748899599/job/18348194309?pr=7413