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

CI: switch to ghactions #23

Merged

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented May 8, 2021

Composer/Ant: move the build scripts to the Composer configuration

As this is a PHP project and the build steps are relatively simple, it will make it more intuitive for contributors to use Composer scripts to run CI checks, than to have to install Ant for this.

This commit creates the same build/CI scripts as were previously available via Ant in the Composer configuration file.

Notes:

  • The scripts are set up to respect the PHP version used by Composer (instead of a system default).
  • The scripts are set up to work equally well on Linux/Windows/Mac.
  • The only two differences are:
    • The mkdir and file deletions won't automatically be done anymore.
      Generally speaking, the mkdir should only need to be run once anyway and the file deletes should not be necessary as the log files will just be overwritten by the tools, so I deemed this an acceptable trade-off.
    • The colors argument won't be set anymore.
      For most tools, this means, the tool will default to automatically determining whether the CLI used supports colourized output.
      As the determination of this in most tools has become pretty good, I, again, deemed this an acceptable trade-off.

CI: switch to GitHub Actions

This commit:

  • Adds a GH Actions cs workflow for the code style and vardump checks which were previously run on Travis.
    These checks only need to run against one PHP version as the results will be the same independently of the PHP version these checks are run on.
  • Adds a GH Actions test workflow for the linting and unit test checks which were previously run on Travis.
  • Uses the cs2pr tool to display the results of the PHP linting and the results of the PHP code style check in-line in the file diff in the PR.
  • Removes the, now redundant, .travis.yml configuration.
  • Updates the .gitattributes file.
  • Updates the "Build Status" badge in the Readme to use the results from the GH Actions runs.

Fixes #13
Fixes #22

jrfnl added 2 commits May 8, 2021 07:52
As this is a PHP project and the build steps are relatively simple, it will make it more intuitive for contributors to use Composer scripts to run CI checks, than to have to install Ant for this.

This commit creates the same build/CI scripts as were previously available via Ant in the Composer configuration file.

Notes:
- The scripts are set up to respect the PHP version used by Composer (instead of a system default).
- The scripts are set up to work equally well on Linux/Windows/Mac.
- The only two differences are:
    - The `mkdir` and file deletions won't automatically be done anymore.
        Generally speaking, the `mkdir` should only need to be run once anyway and the file deletes should not be necessary as the log files will just be overwritten by the tools, so I deemed this an acceptable trade-off.
    - The `colors` argument won't be set anymore.
        For most tools, this means, the tool will default to automatically determining whether the CLI used supports colourized output.
        As the determination of this in most tools has become pretty good, I, again, deemed this an acceptable trade-off.
This commit:
* Adds a GH Actions `cs` workflow for the code style and vardump checks which were previously run on Travis.
    These checks only need to run against one PHP version as the results will be the same independently of the PHP version these checks are run on.
* Adds a GH Actions `test` workflow for the linting and unit test checks which were previously run on Travis.
* Uses the [`cs2pr`](https://github.com/staabm/annotate-pull-request-from-checkstyle) tool to display the results of the PHP linting and the results of the PHP code style check in-line in the file diff in the PR.
* Removes the, now redundant, `.travis.yml` configuration.
* Updates the `.gitattributes` file.
* Updates the "Build Status" badge in the Readme to use the results from the GH Actions runs.
@jrfnl
Copy link
Collaborator Author

jrfnl commented May 8, 2021

@grogy Could you give the Okay for the GH actions to run on this PR ? That way you can see them in action.

GH made a change recently for security reasons that PRs running actions need to be approved the first time the action is run for a new contributor: https://github.blog/changelog/2021-04-22-github-actions-maintainers-must-approve-first-time-contributor-workflow-runs/

@grogy
Copy link
Member

grogy commented May 8, 2021

In GUI i don't see approve button.

The PR looks ok - the idea is good and mistakes in implementations we can resolve in next commit. For it - I merge it ;) Thank you

@grogy grogy merged commit a9ef13c into php-parallel-lint:master May 8, 2021
@grogy
Copy link
Member

grogy commented May 8, 2021

You code as a queen! Works great for the first time 🚀

@jrfnl jrfnl deleted the feature/13-22-switch-to-ghactions branch May 8, 2021 17:26
@jrfnl
Copy link
Collaborator Author

jrfnl commented May 8, 2021

@grogy Glad to hear it, though the actions did run in my own fork, so I'd already tested them and made sure everything was okay.

Either way, two down, one more to go - did you see my PR in the Console Color repo ? Once that one is merged, I can pull a similar PR to this there too.

@jrfnl jrfnl added this to the 1.0.0 milestone Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Switch to using GH Actions Move away from Ant
2 participants