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

GH Actions: various updates #283

Merged
merged 2 commits into from
Oct 24, 2022
Merged

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Oct 14, 2022

GH Actions: fix use of deprecated set-output

GitHub has deprecated the use of set-output (and set-state) in favour of new environment files.

This commit updates workflows to use the new methodology.

Refs:

GH Actions: update the xmllint-problem-matcher

The xmllint-problem-matcher action runner has released a new version which updates it to use node 16.
This gets rid of a warning which was shown in the action logs.

Note: I've suggested to the author to use long-running branches for the action runner instead, which would make this update redundant, but no telling if or when they'll respond to that, let alone if they will follow my suggestion.

Refs:

🆕 GH Actions: harden the workflow against PHPCS ruleset errors

If there is a ruleset error, the cs2pr action doesn't receive an xml report and exits with a 0 error code, even though the PHPCS run failed (though not on CS errors, but on a ruleset error).

This changes the GH Actions workflow to allow for that situation and still fail the build in that case.


👉🏻 Note: this won't get rid of all warning yet as a lot of predefined action runners also use set-output, but most of those are in the process of updating and/or have released a new version already, so the other warnings should automatically disappear over the next few weeks.

@jrfnl
Copy link
Collaborator Author

jrfnl commented Oct 14, 2022

Note: PR #282 is needed to get the build to pass.

@jrfnl jrfnl force-pushed the feature/ghactions-various-updates branch from 32be89b to 165f6e4 Compare October 15, 2022 07:04
@jrfnl
Copy link
Collaborator Author

jrfnl commented Oct 15, 2022

I've removed the second commit - the action runner branch has become a long-running branch, so this update is no longer needed.

@sirbrillig
Copy link
Owner

Great! Thank you!

@sirbrillig
Copy link
Owner

The PHP 7.4 static analysis failure is this, for the record:

Screen Shot 2022-10-15 at 11 44 41 AM

I don't see how your changes could have caused that so I'm guessing it's just that there was an upgrade to the analyzer. If you're fine with merging, I'm fine with that.

@jrfnl
Copy link
Collaborator Author

jrfnl commented Oct 15, 2022

I don't see how your changes could have caused that so I'm guessing it's just that there was an upgrade to the analyzer. If you're fine with merging, I'm fine with that.

Correct. That looks to be related to an update of PHPStan, not to this PR. If you rerun CI on 2.x, the error should also show, which would confirm that it is unrelated to this PR.

Aside from that, a fix for the PHPStan issue is ready in PR #282, so if you'd merge that first, I could rebase this PR after and you can see a clean build.

GitHub has deprecated the use of `set-output` (and `set-state`) in favour of new environment files.

This commit updates workflows to use the new methodology.

Refs:
* https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
* https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
@jrfnl jrfnl force-pushed the feature/ghactions-various-updates branch from 165f6e4 to 18cb721 Compare October 15, 2022 23:45
@jrfnl
Copy link
Collaborator Author

jrfnl commented Oct 15, 2022

Rebased without changes to get a passing build.

If there is a ruleset error, the `cs2pr` action doesn't receive an `xml` report and exits with a `0` error code, even though the PHPCS run failed (though not on CS errors, but on a ruleset error).

This changes the GH Actions workflow to allow for that situation and still fail the build in that case.
@jrfnl
Copy link
Collaborator Author

jrfnl commented Oct 23, 2022

FYI: Added a new second commit with some workflow hardening (and updated the PR description to match).

@sirbrillig
Copy link
Owner

👍 Thank you!

@sirbrillig sirbrillig merged commit 0691145 into 2.x Oct 24, 2022
@sirbrillig sirbrillig deleted the feature/ghactions-various-updates branch October 24, 2022 17:41
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.

2 participants