Skip to content
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

Upgrade GitHub actions #17

Closed
wants to merge 6 commits into from
Closed

Conversation

szepeviktor
Copy link
Contributor

@szepeviktor szepeviktor commented Oct 24, 2023

Please see explanations below.

@@ -1,45 +1,45 @@
# yamllint disable rule:line-length
# yamllint disable rule:braces
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
Copy link
Contributor Author

@szepeviktor szepeviktor Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helps IDE-s to validate YAML while writing.


name: CI

on:
pull_request:
pull_request: null
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the YAML default value. Strange!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs never set the default value. I'd like to skip it here to because it is not an error, and it is confusing.

Copy link
Contributor Author

@szepeviktor szepeviktor Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what we have here in this PR.
You have no devops guy, and I do only devops.

Copy link
Contributor Author

@szepeviktor szepeviktor Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs never set the default value.

GitHub docs is for people who don't have 101 hours to fiddle with YAML and bytes in general. Who have to deliver today!

Comment on lines 11 to 13
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stop previous runs.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd argue there's value in seeing previous builds finish to the end.

runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
coverage: ['pcov']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A single value does not make a matrix.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reuse this workflow elsewhere, where I could use xdebug. And I don't want to maintain several vastly different workflows, please.

@@ -52,38 +52,38 @@ jobs:
composer remove --no-update --dev --no-interaction --no-progress \
phan/phan phpstan/phpstan vimeo/psalm \
infection/infection friendsofphp/php-cs-fixer
composer update --prefer-dist --no-interaction --no-progress ${{ matrix.dependencies }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-existent matrix value.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It is not an error.
  • I have in another project, so if we make this change I won't be able to git am changes from here to there.

php vendor/bin/phpunit
./vendor/bin/phpunit
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpunit binary should be executable.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets crazy in Windows, so I'd prefer the existing variant which, to my best knowledge, works everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -65 to +66
env:
PHP_VERSION: '8.2'
strategy:
matrix:
php-version: ['8.2']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always use a matrix.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused: in one case you remove the matrix because "a single value does not make a matrix" and in another place you introduce the matrix with a single value 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I would require tools in composer.json.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it actually runs PHP CS Fixer another time before the static analysis. The reason there's another stage for PHP CS Fixer because I want to be able to see that there are coding style issues right away, and last time I checked this was the fastest way to do just the code style check.

COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ github.token }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The secret token has a new name.

composer-validate: test-prerequisites
composer-validate:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Composer should validate what we have in the repo, not generated files

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly what I don't want because composer validate --strict will fail if the lock file is out of date. And we don't have a lock file unless we do composer install or like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do composer update the lock file will always be okay!

Copy link
Owner

@sanmai sanmai Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly! But if we mess up the Makefile, and we don't do composer update because of a mistake, there's no way to see this! It is where composer validate comes to point that we messed up. Please put it back.

@szepeviktor
Copy link
Contributor Author

🔗 My take on checking PHP code
https://github.com/szepeviktor/byte-level-care/blob/master/.github/workflows/back-end.yml

strategy:
matrix:
php-version: ['8.2']
php-cs-fixer-version: ['v3.35.1']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"A single value does not make a matrix." 😬

Copy link
Owner

@sanmai sanmai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you mean well yet some changes aren't acceptable.

@@ -36,10 +34,10 @@ jobs:

- name: Validate composer.json
run: |
composer validate --strict
make composer-validate
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put it back as well 🙏

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Oct 24, 2023

I am sorry. This is too hard for me.
Maybe I am not able to act outside my golden cage 🐦

@sanmai
Copy link
Owner

sanmai commented Oct 24, 2023

I'm sorry I made you feel bad. Would you mind if I tag you as a co-author for the changes I likes?

@szepeviktor
Copy link
Contributor Author

Would you mind if I tag you as a co-author for the changes I likes?

Okay.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants