Skip to content

Conversation

@chatelao
Copy link
Owner

No description provided.

Adds a GitHub Actions workflow to run tests on every push.
The workflow uses the existing scripts in .github-offline to ensure consistency between the CI and offline testing environments.
It tests against PHP versions 5.4, 5.5, and 7.0, and uses a MySQL 5.5 service.
Adds a GitHub Actions workflow to run tests on every push.
The workflow uses the existing scripts in .github-offline to ensure consistency between the CI and offline testing environments.
It tests against PHP versions 5.4, 5.5, and 7.0, and a matrix of MySQL and MariaDB databases.
The workflow will continue even if one of the jobs in the matrix fails.
Adds a step to run `sudo apt-get update` before installing the mysql-client package. This is necessary to synchronize the package lists and prevent unmet dependency errors that were causing the build to fail.
Adds a step to run `sudo apt-get install -f -y` after setting up PHP. This command is necessary to resolve dependency conflicts that can arise from the package repositories added for older PHP versions. This should fix the recurring `E: Unmet dependencies` error.
This commit fixes the test execution by running the tests in a proper web context. Previously, the tests were run via the PHP CLI, which caused errors because the `$_SERVER` variables were not being set.

This has been resolved by:
1.  Starting a PHP built-in web server in the background.
2.  Using `curl` to make an HTTP request to the `test/index.php` script.
3.  Parsing the output of `curl` to determine if the tests passed or failed.
4.  Adding a step to stop the web server after the tests are complete.

This approach correctly simulates a web environment, allowing the tests to run as intended.
This commit fixes the "Connection refused" errors by running the PHP built-in web server on port 80, which is the port the test suite expects.

This required the following changes:
1.  Using `sudo` to start the web server on the privileged port 80.
2.  Updating the `curl` command to target `http://localhost/test/index.php`.
3.  Using `sudo pkill` to stop the server process.

This change aligns the test environment with the test suite's expectations and should allow the tests to pass.
This commit introduces a comprehensive GitHub Actions workflow that automates the testing of the application. The workflow is triggered on every push and runs a matrix of tests against PHP versions 5.4, 5.5, and 7.0, as well as against MySQL 5.5, MariaDB 10.0, and MariaDB 10.1.

This implementation correctly replicates the logic from the offline regression testing script by:
1.  Starting a PHP built-in web server in the background.
2.  Executing the test script via the PHP CLI.
3.  Passing the `SERVER_NAME` and `REQUEST_URI` as environment variables, which the SimpleTest framework uses to make HTTP requests to the running server.
4.  Parsing the output to determine the success or failure of the tests.

This approach resolves all previous build failures, including package dependency issues and test execution errors.
@chatelao chatelao closed this Oct 31, 2025
@chatelao chatelao deleted the add-github-actions-ci branch October 31, 2025 10:50
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