Skip to content

Commit b14381e

Browse files
committed
Initial commit
0 parents  commit b14381e

File tree

134 files changed

+15304
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+15304
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_size = 4
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=77KW4LBEYBD9U"

.github/workflows/tests.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '*.md'
7+
8+
env:
9+
PLUGIN_NAME: PerformanceAudit
10+
TEST_SUITE: PluginTests
11+
MYSQL_ADAPTER: PDO_MYSQL
12+
13+
jobs:
14+
phpunit:
15+
strategy:
16+
matrix:
17+
php-versions: ['7.1']
18+
#php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0']
19+
matomo-versions: ['3.12.0', '3.13.6']
20+
node-version: [12.x]
21+
#node-version: [10.x, 12.x]
22+
23+
runs-on: ubuntu-latest
24+
25+
name: PHPUnit with PHP ${{ matrix.php-versions }}, Node.js ${{ matrix.node-version }} and Matomo ${{ matrix.matomo-versions }}
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php-versions }}
34+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, iconv
35+
coverage: none
36+
tools: composer, phpunit:7.5.20
37+
38+
- name: Use Node.js ${{ matrix.node-version }}
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: ${{ matrix.node-version }}
42+
43+
- name: Create database
44+
run: |
45+
sudo /etc/init.d/mysql start
46+
mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS matomo_tests;'
47+
48+
- name: Clone Matomo and run plugin Tests
49+
# TODO
50+
run: |
51+
shopt -s extglob
52+
mkdir ${{ env.PLUGIN_NAME }}
53+
cp -R !(${{ env.PLUGIN_NAME }}) ${{ env.PLUGIN_NAME }}
54+
cp -R .git/ ${{ env.PLUGIN_NAME }}/
55+
56+
git clone --config filter.lfs.smudge=true -q https://github.com/matomo-org/matomo.git matomo
57+
cd matomo
58+
git fetch --all
59+
git submodule update
60+
git checkout -q tags/${{ matrix.matomo-versions }}
61+
[ -d ./tests/travis/.git ] || sh -c "rm -rf ./tests/travis && git clone https://github.com/matomo-org/travis-scripts.git ./tests/travis"
62+
cd ./tests/travis
63+
git checkout master
64+
cd ../..
65+
[ ! -f ./tests/travis/check_plugin_compatible_with_piwik.php ] || php ./tests/travis/check_plugin_compatible_with_piwik.php "${{ env.PLUGIN_NAME }}"
66+
composer install --no-dev --no-progress
67+
rm -rf plugins/${{ env.PLUGIN_NAME }}
68+
mv ../${{ env.PLUGIN_NAME }} plugins
69+
echo './console tests:run PerformanceAudit'
70+
env:
71+
DB_PASSWORD: root

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
composer.lock
2+
node_modules/**/
3+
package-lock.json
4+
ToDo.md
5+
*.cache
6+
7+
# OS or Editor folders
8+
.cache
9+
.DS_Store
10+
.idea
11+
.project
12+
.settings
13+
.tmproj
14+
*.sublime-project
15+
*.sublime-workspace
16+
Thumbs.db

.php_cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->notPath('docs')
5+
->notPath('lang')
6+
->notPath('node_modules')
7+
->notPath('screenshots')
8+
->notPath('templates')
9+
->notPath('vendor')
10+
->in(__DIR__)
11+
->name('*.php')
12+
->ignoreDotFiles(true)
13+
->ignoreVCS(true);
14+
15+
return PhpCsFixer\Config::create()
16+
->setRules([
17+
'@PSR2' => true,
18+
'array_syntax' => ['syntax' => 'short'],
19+
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
20+
'no_unused_imports' => true,
21+
'not_operator_with_successor_space' => false,
22+
'trailing_comma_in_multiline_array' => false,
23+
'no_trailing_comma_in_singleline_array' => true,
24+
'phpdoc_scalar' => true,
25+
'unary_operator_spaces' => true,
26+
'binary_operator_spaces' => true,
27+
'blank_line_before_statement' => [
28+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
29+
],
30+
'braces' => false,
31+
'phpdoc_single_line_var_spacing' => true,
32+
'phpdoc_var_without_name' => true,
33+
'class_attributes_separation' => [
34+
'elements' => [
35+
'method', 'property',
36+
],
37+
],
38+
'method_argument_space' => [
39+
'on_multiline' => 'ensure_fully_multiline',
40+
'keep_multiple_spaces_after_comma' => true,
41+
]
42+
])
43+
->setFinder($finder);

0 commit comments

Comments
 (0)