Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ This action is able to run certain test suites for Matomo or any Matomo plugin.
Defines which Mysql adapter Matomo should use to connect to the database. Can be set to `PDO_MYSQL` (default) or `MYSQLI`.


* **mysql-timezone**

Timezone for the database container, e.g. `Pacific/Auckland`. Defaults to `UTC`, which is what CI has always run, so leaving it unset changes nothing.

Matomo stores datetimes in `log_visit` and elsewhere in UTC, but SQL that reads a date back out of those columns can depend on the server's timezone. Because CI runs UTC, that class of bug passes here and only shows up for users whose database server is not on UTC. Setting a non-UTC value makes the server report that zone via `@@system_time_zone` while leaving `@@global.time_zone` at `SYSTEM`, which is how such a server is really configured.


* **upload-artifacts**

If set to true produced artifacts will be uploaded to https://build-artifacts.matomo.org
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ inputs:
description: "Mysql version to use for testing. Defaults to '5.7' for 'Mysql', and 'latest' for 'Mariadb' or 'Tidb'"
required: false
default: ''
mysql-timezone:
description: "Timezone for the database container, e.g. 'Pacific/Auckland'. Defaults to UTC, which is what CI has always run. A non-UTC value makes the server report that zone as SYSTEM, exercising code that reads dates out of the DATETIME columns Matomo stores in UTC."
required: false
default: 'UTC'
matomo-test-branch:
description: "Branch or tag name of Matomo to run plugin tests for. This can be either a specific name or maximum_supported_matomo or minimum_required_matomo."
required: false
Expand Down Expand Up @@ -115,6 +119,7 @@ runs:
-p 3306:3306 \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
-e MYSQL_DATABASE=matomo_tests \
-e TZ=${{ inputs.mysql-timezone || 'UTC' }} \
mirror.gcr.io/library/mysql:${{ inputs.mysql-version || '5.7' }}

for i in $(seq 1 30); do
Expand Down Expand Up @@ -142,6 +147,7 @@ runs:
-p 3306:3306 \
-e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 \
-e MARIADB_DATABASE=matomo_tests \
-e TZ=${{ inputs.mysql-timezone || 'UTC' }} \
mirror.gcr.io/library/mariadb:${{ inputs.mysql-version || 'latest' }}

for i in $(seq 1 30); do
Expand Down