Skip to content

Commit

Permalink
Merge pull request #10 from wmde/use-woodpecker-ci
Browse files Browse the repository at this point in the history
Use Woodpecker CI
  • Loading branch information
moiikana authored Jan 30, 2025
2 parents c411570 + bcd466e commit de76f45
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 19 deletions.
22 changes: 22 additions & 0 deletions .ci/config.ini.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
; <?php exit; ?> DO NOT REMOVE THIS LINE
; file automatically generated or modified by Matomo; you can manually override the default values in global.ini.php by redefining them in this file.
[database]
host = "database"
username = "root"
password = "toor"
dbname = "matomo"

[database_tests]
host = "database"
username = "root"
password = "toor"
dbname = "matomo_t"

[Development]
enabled = 1
disable_merged_assets = 1

[tests]
http_host = "localhost"
port = 8080
request_uri="/"
42 changes: 42 additions & 0 deletions .woodpecker/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
clone:
git:
image: woodpeckerci/plugin-git
settings:
lfs: false

steps:
- name: build
image: registry.gitlab.com/fun-tech/fundraising-frontend-docker:latest
commands:
- mkdir -p /woodpecker/src/github.com/matomo-org

# Clone and configure Matomo with our plugin as a symlink
- git clone --depth=1 -b 4.16.1 https://github.com/matomo-org/matomo /woodpecker/src/github.com/matomo-org/matomo
- ln -s $CI_WORKSPACE /woodpecker/src/github.com/matomo-org/matomo/plugins/CampaignVisitorsByTime
- cp $CI_WORKSPACE/.ci/config.ini.php /woodpecker/src/github.com/matomo-org/matomo/config/config.ini.php

# Create database environment with fixtures
- cd /woodpecker/src/github.com/matomo-org/matomo/
# The fixture script runs the `mysql` command, we need to install it
- apt update
- apt install -y mariadb-client
- composer install --ignore-platform-req=ext-gd
# the fixture setup needs a running web server, we'll start one in the background
# and kill it when the fixture setup is done
- php -S 0.0.0.0:8080 &
- PHP_PID=$!
- php -d memory_limit=8G console tests:setup-fixture UITestFixture
- kill $PHP_PID

# Finally run the unit test
- ./console tests:run plugins/CampaignVisitorsByTime/tests/Unit/DataProcessorTest.php

services:

- name: database
image: mariadb:10.4
environment:
- MYSQL_ROOT_PASSWORD=toor
- MYSQL_USER=matomo
- MYSQL_PASSWORD=matomo
- MYSQL_DATABASE=matomo
2 changes: 1 addition & 1 deletion tests/Fixtures/TestDataProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @license GNU GPL v3+
*/

namespace Piwik\Plugins\CampaignVisitorsByTime\Test\Fixtures;
namespace Piwik\Plugins\CampaignVisitorsByTime\tests\Fixtures;

use Piwik\Plugins\CampaignVisitorsByTime\DataProcessor;

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/DataProcessorTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Piwik\Plugins\CampaignVisitorsByTime\Test\Unit;
namespace Piwik\Plugins\CampaignVisitorsByTime\tests\Unit;

use PHPUnit\Framework\TestCase;
// we need to extend the system-under-test to get around Matomo static access
use Piwik\Plugins\CampaignVisitorsByTime\Test\Fixtures\TestDataProcessor;
use Piwik\Plugins\CampaignVisitorsByTime\tests\Fixtures\TestDataProcessor;

/**
* @covers \Piwik\Plugins\CampaignVisitorsByTime\DataProcessor
Expand Down
16 changes: 0 additions & 16 deletions tests/bootstrap.php

This file was deleted.

0 comments on commit de76f45

Please sign in to comment.