Skip to content

GitHub Actions CI #6

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

Merged
merged 28 commits into from
Mar 21, 2022
Merged

GitHub Actions CI #6

merged 28 commits into from
Mar 21, 2022

Conversation

NattyNarwhal
Copy link
Member

@NattyNarwhal NattyNarwhal commented Feb 9, 2022

This:

  • Builds the driver on all supported PHP versions for Windows (7.4, 8.0, 8.1)
  • Builds the driver on all supported PHP versions for Ubuntu (7.3, 7.4, 8.0, 8.1), starts Db2 for Linux in a Docker container, and runs the test suite on it
  • Makes any changes needed to make the test suite pass

runs-on: ubuntu-latest
steps:
- name: Install DB2 library
# XXX: Can this be optimized to not constantly redownload? Or be put in a better place?
Copy link

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

Definitely would be helpful to cache, I think. I know the PRs for python-ibmdb were failing for a while due to flakiness in the IBM download site.

@NattyNarwhal
Copy link
Member Author

Beaten into better shape, though the PHP 8.0 failure is bizarre; it's as if it was trying to link it as a normal executable instead of a library?

@kadler
Copy link

kadler commented Feb 10, 2022

Beaten into better shape, though the PHP 8.0 failure is bizarre; it's as if it was trying to link it as a normal executable instead of a library?

make V=1?

@kadler
Copy link

kadler commented Feb 10, 2022

Seems to be some something weird with libtool. It's calling libtool --mode=compile cc which seems to be not passing the -c flag.

#ifdef PASE /* i5/OS ease of use turn off/on */
ZEND_BEGIN_MODULE_GLOBALS(pdo_ibm)
Copy link

Choose a reason for hiding this comment

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

Another option would be to define a "uses globals" flag instead of hardcoding to PASE in case other platforms need it in the future, eg.

#if defined(PASE)
#define PDO_IBM_USES_GLOBALS
#endif

#ifdef PDO_IBM_USES_GLOBALS
ZEND_BEGIN_MODULE_GLOBALS(pdo_ibm)
...
#endif

Of course, that might be needless future-proofing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not a bad idea, but considering ibm_db2 went a long while without any non-PASE globals, might also be needless, yeah.

@NattyNarwhal NattyNarwhal changed the title WIP: GitHub Actions CI GitHub Actions CI Mar 18, 2022
The PDO extensions bundled with PHP moved to this style (well, they
don't include the legacy check; this mirrors how it was in 7.3)

Pushed to CI branch to see how it affects it.
This only builds the driver on Ubuntu. macOS and Windows, as well
as starting the LUW Docker container are TODO.
MSVC doesn't allow it, so should unbreak Windows builds.

Made to CI branch, but can cherry pick back to main.
Christoph pointed out this was wrong with the new macro; very subtle!
In spirit to what PHP does with MSSQL.
Add additional environment variables for the DSN INI et al
the "automatic storage yes" is something I remembered last time I had to
deal with LUW.

Try to remove tty/interactive flags from docker exec

Try to wait for Db2 to finish up setup (not ideal)

We don't need to create the database, the Docker container made one all along

Actually check if setup is complete
It's hard to predict what we'll be running on.
The 1/2 keys will always be empty, whereas before they had some cruft
about non-existent files. In theory we could force it to be like how it
was, but no other drivers do so.
I'm not sure how the original version of the test ever made sense when I
was reading it. The behaviour it expects seemed counter-intuitive with
how it was expecting casting to happen.

Bizarrely, the IBM i version does match the behaviour of modern PHP and Db2.
So, let's just put that in its place.
Not sure how to get this working for now, but we can revisit it.
It seems on PHP 7.x, the order in which they're inserted matters,
at least for `fvt_025_ColumnMetaData`. Tested on PHP 7.4/LUW.
On PHP 8.1, the skip cache seemingly collates all the reused skip
sections into a single file. However, the skip check relies on using
the name of the test to determine if it should be skipped based on
platform. This is why the skip blocks that *aren't* the same will
trigger reliably.

This will slow it down a smidge, but work reliably until the skip
checks are refactored.
One of the LOB tests exhibited this. I don't know if NULL is the
best thing to return, but it can be considered.
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