And in steps right after repo checkout need to add PHP headers and capability for running PHP code. Thanks to shivammathur/setup-php@v2 it's pretty easy to achieve:
steps:-uses:actions/checkout@v2-name:Setup PHP 7.4 with PECL extensionuses:shivammathur/setup-php@v2with:php-version:'7.4'
After that we're ready to install development tools and check their versions:
Here you can note that we're able to extend the matrix and configure for each environment its own workflow.
In the build process there is one huge disadvantage - it takes a lot of resources and plenty of time. It's bad to occupy resources, when they aren't needed. That's why it's worth it to cache compiled object files.
But, honestly, I think this config isn't really correctly configured for my case. The idea was in caching compiled object files and later just use that directory and linker would use that object files (in the install script from the next step). But looks like it doesn't work as I've expected and the compiler compiles object files even when no changes are made in dependencies. I'll be very appreciated for an advice.
I've created an install script for updating dependencies for shared lib builds. It takes the build path as the first argument, pulls the latest code from tdlib/td, CopernicaMarketingSoftware/PHP-CPP and nlohmann/json repositories and builds separately as shared libraries.
And need to specify when it is needed to trigger actions. In my case I also want to configure scheduled runs more often (twice in a month) because build fails would notify me that need to update dependencies.
Before I used travis, but it accidentally stopped working for me at some point, and I've decided to migrate to GitHub Actions. Right now it's not ideal and uses just one config and one entry in the matrix, but it's doing its job and can be configured better in future.
Thanks for reading =)
The PHP extension tdlib allows you to work with the Telegram database library
If simple, this is the usual functions wrapper for working with the tdlib/td json client. You can:
create a JSON client $client = td_json_client_create()
execute the synchronous request $result = td_json_client_execute($client, $json);
perform an asynchronous request td_json_client_send($client, $json); *
get all the responses at the moment $response = td_json_client_receive($client, $timeout);
and destroy client td_json_client_destroy($client);
* you must use td_json_client_receive to get a response from an asynchronous request.