-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Move phpcs from Travis to GitHub Actions #3979
Conversation
bb366de
to
05be601
Compare
fedae68
to
62a7028
Compare
#3978 was merged :) |
62a7028
to
c36f2aa
Compare
c36f2aa
to
3331b6d
Compare
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.
Please add cs2pr
, I noticed @beberlei did that on ORM (master branch). I'm doing so in a PR to 2.7: doctrine/orm#8116
3331b6d
to
813ab87
Compare
f1e446a
to
d034575
Compare
d034575
to
25e00a9
Compare
25e00a9
to
b46e86e
Compare
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.
👌
Is there a way to see how |
@@ -6,28 +6,66 @@ on: | |||
|
|||
jobs: | |||
static-analysis-psalm: | |||
name: Static Analysis with Psalm | |||
runs-on: ubuntu-latest | |||
name: "Static Analysis with Psalm" |
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.
Are changes like this really needed? I'd rather keep it simple and only add quotes where required (e.g. strings with special characters, numeric strings that must remain strings, etc.).
This file will be maintained by humans who will not see the need to add quotes everywhere.
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.
It is trying to maintain consistency across repos
https://github.com/doctrine/orm/pull/8116/files
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 what's the reason why we want to have all strings quoted in all repositories?
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.
i suspect inspiration from https://github.com/ergebnis/php-library-template/blob/master/.github/workflows/integrate.yaml
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.
it's just coding style, and that repo enforces it:
https://github.com/ergebnis/php-library-template/blob/master/.yamllint.yaml
I personally don't like everything quoted, as you point out it's not necessary all the time. but being consistent is the main thing i guess.
cc @localheinz
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.
I am using ibiqlik/action-yamllint
to lint YAML files using yamllint
, and for consistency, I quote YAML strings.
As @bendavies pointed out, it's a matter of taste and consistency. I have to admit that I dislike having to escape a bunch of characters when quoting.
with: | ||
path: "~/.composer/cache" | ||
key: "composer-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "composer-" | ||
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
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.
This looks like an unnecessary complication. What's the scenario where we're going to run the code style check using different PHP versions?
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.
This has already been discussed. It is trying to maintain consistency across repos
https://github.com/doctrine/orm/pull/8116/files
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.
Could you point me to the thread, please? I could find the discussion regarding the build matrix.
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.
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.
sorry, let me elaborate, because that link doesn't help you.
I think, even if the matrix has a single php version, it enables us to use the same key
everywhere, which helps cache hits. rather than using
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
where a matrix is used and
key: "php-7.4-composer-locked-${{ hashFiles('composer.lock') }}"
where a matrix is not used.
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, by “everywhere” you mean that if named consistently, the same cache entry can be shared between multiple actions? Makes sense in this case.
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.
Multiple action in the same repo yes. Thanks for phrasing it better!
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: |
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.
I believe the whole point of static analysis is that it's static and doesn't depend on the runtime environment. Having a matrix here looks like overkill to me.
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.
It is trying to maintain consistency across repos
https://github.com/doctrine/orm/pull/8116/files
Looks good. Should we test #3979 (comment) and squash everything before the merge? |
Sure. I can do it later, or feel free to push to my branch if you are available now. |
58bc4d4
to
b46e86e
Compare
After merging up all the way until master, let's add this check as well as Psalm as required, shall we? |
Thanks a lot @bendavies ! |
Summary
Moves phpcs from Travis to GitHub Actions.
#3978 needs merging first.