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

MNT: PHP 8, switch from Tavis to Github Actions #47

Merged
merged 2 commits into from
Oct 3, 2022

Conversation

chrispenny
Copy link
Collaborator

@chrispenny chrispenny commented Sep 28, 2022

  • Remove Travis - switch to Github Actions
  • Minimum PHP requirement is now 7.4
  • PHP ^8 support added
    • Really just had to add some null coalescing operators in some spots
  • Upgrade to PHP Unit ^9
    • Some very minor test contract changes (no functional changes)
  • pgsql tests were failing due to PopulateFactory::createObject().

@chrispenny chrispenny marked this pull request as ready for review September 29, 2022 18:25
Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

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

Looks good, though the workflow file isn't quite standardised with all the other workflow files on the silverstripe account

with:
dynamic_matrix: false
extra_jobs: |
- php: 7.4
Copy link
Member

Choose a reason for hiding this comment

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

Generally better off using the dynamic matrix because it will stay up to date over time e.g. will automatically add an 8.2 job when silverstripe/gha-ci adds support for it - is there a strong reason you have a non-dynamic matrix here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@emteknetnz the pgsql tests fail with the standard matrix. I wasn't really trying to fix anything that is already broken, I just wanted to get us up to date with PHP ^8.

Maybe I could raise an Issue regarding PostgreSQL and moving to the standard matrix?

Copy link
Member

Choose a reason for hiding this comment

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

I think you should retain the dynamic matrix for better standardization

The failure in https://github.com/silverstripe/silverstripe-populate/actions/runs/3146840126/jobs/5115740952 look like it's a quoting issue. There is likely a 'raw' sql like statement that in the populate codebase that just needs some double quotes put around it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@emteknetnz I've searched around for DB:: and SQL, but I can't find any raw queries being made. This is potentially a bit of a deeper issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@emteknetnz I've raised a follow up Issue:
#48

Hopefully this is acceptable, as we're not currently testing PostgreSQL anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I think we'll have to go for this for now. I did a quick investigation into the postgres failure though I didn't see anything obvious. For some reason Title is being converted to title, it may be something in either the framework or postgresql modules rather than populate


on:
push:
pull_request:
Copy link
Member

Choose a reason for hiding this comment

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

Should ideally put this on a cron to ensure integration with other modules is working correctly

You can copy the cron syntax from here https://github.com/silverstripe/silverstripe-framework/blob/4/.github/workflows/ci.yml#L8

Also include the account check so that the cron doesn't run on any forks - https://github.com/silverstripe/silverstripe-framework/blob/4/.github/workflows/ci.yml#L15

You'll also need copy paste in keepalive.yml to ensure the cron doesn't stop after 60 days of no repo activity - https://github.com/silverstripe/silverstripe-framework/blob/4/.github/workflows/keepalive.yml

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

6ff2f08

@emteknetnz emteknetnz merged commit 4a00470 into master Oct 3, 2022
@emteknetnz emteknetnz deleted the mnt/php8-github-actions branch October 3, 2022 21:27
@emteknetnz
Copy link
Member

@chrispenny I've tagged 2.2.0 for 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.

2 participants