From be0463488960318c76c69e22c83e8d0d82657b1a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 5 Jul 2024 16:14:15 -0700 Subject: [PATCH 01/10] Update test env. Signed-off-by: Matt Friedman --- .github/workflows/tests.yml | 62 ++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 03563d4..99da3bf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ on: jobs: # START Basic Checks Job (EPV, code sniffer, images check, etc.) basic-checks: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: include: @@ -33,14 +33,14 @@ jobs: steps: - name: Checkout phpBB - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: phpbb/phpbb ref: ${{ env.PHPBB_BRANCH }} path: phpBB3 - name: Checkout extension - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: phpBB3/phpBB/ext/${{ env.EXTNAME }} @@ -89,28 +89,26 @@ jobs: # START MySQL and MariaDB Job mysql-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: include: - - php: '7.1' + - php: '7.2' db: "mariadb:10.1" - - php: '7.1' + - php: '7.2' db: "mariadb:10.2" - - php: '7.1' + - php: '7.2' db: "mariadb:10.3" - - php: '7.1' + - php: '7.2' db: "mariadb:10.4" - - php: '7.1' + - php: '7.2' db: "mariadb:10.5" - - php: '7.1' + - php: '7.2' db: "mysql:5.6" db_alias: "MyISAM Tests" MYISAM: 1 - - php: '7.1' + - php: '7.2' db: "mysql:5.6" - - php: '7.1' - db: "mysql:5.7" - php: '7.2' db: "mysql:5.7" COVERAGE: 1 @@ -127,6 +125,10 @@ jobs: db: "mysql:5.7" - php: '8.2' db: "mysql:5.7" + - php: '8.3' + db: "mysql:5.7" + - php: '8.4' + db: "mysql:5.7" name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} @@ -156,14 +158,14 @@ jobs: steps: - name: Checkout phpBB - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: phpbb/phpbb ref: ${{ env.PHPBB_BRANCH }} path: phpBB3 - name: Checkout extension - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: phpBB3/phpBB/ext/${{ env.EXTNAME }} @@ -240,22 +242,20 @@ jobs: # START PostgreSQL Job postgres-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: include: - - php: '7.1' + - php: '7.2' db: "postgres:9.5" - - php: '7.1' + - php: '7.2' db: "postgres:9.6" - - php: '7.1' + - php: '7.2' db: "postgres:10" - - php: '7.1' + - php: '7.2' db: "postgres:11" - - php: '7.1' + - php: '7.2' db: "postgres:12" - - php: '7.1' - db: "postgres:13" - php: '7.2' db: "postgres:13" - php: '7.3' @@ -270,6 +270,10 @@ jobs: db: "postgres:14" - php: '8.2' db: "postgres:14" + - php: '8.3' + db: "postgres:14" + - php: '8.4' + db: "postgres:14" name: PHP ${{ matrix.php }} - ${{ matrix.db }} @@ -301,14 +305,14 @@ jobs: steps: - name: Checkout phpBB - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: phpbb/phpbb ref: ${{ env.PHPBB_BRANCH }} path: phpBB3 - name: Checkout extension - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: phpBB3/phpBB/ext/${{ env.EXTNAME }} @@ -354,11 +358,11 @@ jobs: # START Other Tests Job (SQLite 3 and mssql) other-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: include: - - php: '7.1' + - php: '7.2' db: "sqlite3" - php: '7.2' db: "mcr.microsoft.com/mssql/server:2017-latest" @@ -396,14 +400,14 @@ jobs: steps: - name: Checkout phpBB - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: phpbb/phpbb ref: ${{ env.PHPBB_BRANCH }} path: phpBB3 - name: Checkout extension - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: phpBB3/phpBB/ext/${{ env.EXTNAME }} From 9f84fef0e4bbdec5d6f2f5fcd16c9f276515c202 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 5 Jul 2024 16:14:27 -0700 Subject: [PATCH 02/10] Update phpBB requirements Signed-off-by: Matt Friedman --- composer.json | 2 +- ext.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 65dea40..b46a835 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "extra": { "display-name": "Google Analytics", "soft-require": { - "phpbb/phpbb": ">=3.2.0" + "phpbb/phpbb": ">=3.2.0,<4.0.0@dev" }, "version-check": { "host": "www.phpbb.com", diff --git a/ext.php b/ext.php index dede459..75220f6 100644 --- a/ext.php +++ b/ext.php @@ -19,6 +19,7 @@ class ext extends base */ public function is_enableable() { - return phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>='); + return phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>=') + && phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '<'); } } From 91bc0509b19a1dcd0a48a740829e8f0aac3da642 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 10 Apr 2025 21:08:50 -0700 Subject: [PATCH 03/10] Repo fixes --- .github/workflows/tests.yml | 8 ++++---- README.md | 2 +- composer.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 99da3bf..5b2b2db 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -358,7 +358,7 @@ jobs: # START Other Tests Job (SQLite 3 and mssql) other-tests: - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 strategy: matrix: include: @@ -368,14 +368,14 @@ jobs: db: "mcr.microsoft.com/mssql/server:2017-latest" db_alias: 'MSSQL 2017' - php: '7.2' - db: "mcr.microsoft.com/mssql/server:2019-latest" + db: "mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04" db_alias: 'MSSQL 2019' name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} services: mssql: - image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-latest' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }} + image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }} env: SA_PASSWORD: "Pssw0rd_12" ACCEPT_EULA: "y" @@ -415,7 +415,7 @@ jobs: env: MATRIX_DB: ${{ matrix.db }} run: | - if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-latest' ] + if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ] then db='mssql' else diff --git a/README.md b/README.md index 540a50d..380fab7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A phpBB official extension that allows administrators to easily add Google Analytics to their forums. -[![Build Status](https://github.com/phpbb-extensions/googleanalytics/workflows/Tests/badge.svg)](https://github.com/phpbb-extensions/googleanalytics/actions) +[![Build Status](https://github.com/phpbb-extensions/googleanalytics/actions/workflows/tests.yml/badge.svg)](https://github.com/phpbb-extensions/googleanalytics/actions) [![codecov](https://codecov.io/gh/phpbb-extensions/googleanalytics/branch/master/graph/badge.svg?token=1HQh953sBs)](https://codecov.io/gh/phpbb-extensions/googleanalytics) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phpbb-extensions/googleanalytics/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phpbb-extensions/googleanalytics/?branch=master) diff --git a/composer.json b/composer.json index b46a835..e8be075 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "composer/installers": "~1.0" }, "require-dev": { - "phing/phing": "2.4.*" + "phing/phing": "~2.4" }, "extra": { "display-name": "Google Analytics", From 4bf0ee74f44ccc1994d3a14192859704ffff4813 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 15 Apr 2025 15:17:51 -0700 Subject: [PATCH 04/10] Update tests.yml --- .github/workflows/tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5b2b2db..c2a7953 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -358,24 +358,24 @@ jobs: # START Other Tests Job (SQLite 3 and mssql) other-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: include: - php: '7.2' db: "sqlite3" - - php: '7.2' - db: "mcr.microsoft.com/mssql/server:2017-latest" - db_alias: 'MSSQL 2017' - php: '7.2' db: "mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04" db_alias: 'MSSQL 2019' + - php: '7.2' + db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04" + db_alias: 'MSSQL 2022' name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} services: mssql: - image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2017-latest' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && 'mcr.microsoft.com/mssql/server:2017-latest' || matrix.db }} + image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' || matrix.db }} env: SA_PASSWORD: "Pssw0rd_12" ACCEPT_EULA: "y" @@ -415,7 +415,7 @@ jobs: env: MATRIX_DB: ${{ matrix.db }} run: | - if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2017-latest' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ] + if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ] then db='mssql' else From c81f6298c302306f7669ca554b79a0d567381647 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 15 Apr 2025 15:37:37 -0700 Subject: [PATCH 05/10] Update tests.yml [ci skip] --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c2a7953..bd6d021 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -227,7 +227,7 @@ jobs: run: | if [ $COVERAGE == '1' ] then - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml + phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml --testsuite 'phpBB Test Suite' else phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php fi From bee0df56f07011c2146f1bb101d07d0d5dc1d937 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sat, 19 Apr 2025 14:56:50 -0700 Subject: [PATCH 06/10] Update tests.yml [ci skip] --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bd6d021..c2a7953 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -227,7 +227,7 @@ jobs: run: | if [ $COVERAGE == '1' ] then - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml --testsuite 'phpBB Test Suite' + phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml else phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php fi From 6dd2aef8f8aced1967b4f4132dc09fccb05ebedc Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sun, 20 Apr 2025 09:02:31 -0700 Subject: [PATCH 07/10] Update tests.yml to reusable test framework --- .github/workflows/tests.yml | 460 ++---------------------------------- 1 file changed, 16 insertions(+), 444 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c2a7953..33a073b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,457 +1,29 @@ name: Tests -env: - EXTNAME: phpbb/googleanalytics # Your extension vendor/package name - SNIFF: 1 # Run code sniffer on your code? 1 or 0 - IMAGE_ICC: 1 # Run icc profile sniffer on your images? 1 or 0 - EPV: 1 # Run EPV (Extension Pre Validator) on your code? 1 or 0 - EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0 - PHPBB_BRANCH: 3.3.x # The phpBB branch to run tests on - on: push: branches: # Run tests when commits are pushed to these branches in your repo + - main - master - develop + - dev/* pull_request: # Run tests when pull requests are made on these branches in your repo branches: + - main - master - develop + - dev/* jobs: - # START Basic Checks Job (EPV, code sniffer, images check, etc.) - basic-checks: - runs-on: ubuntu-22.04 - strategy: - matrix: - include: - - php: '7.2' - db: "none" - NOTESTS: 1 - - name: PHP ${{ matrix.php }} - ${{ matrix.db }} - - steps: - - name: Checkout phpBB - uses: actions/checkout@v4 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v4 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap - coverage: none - - - name: Setup environment for phpBB - env: - DB: ${{ matrix.db }} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '1' - run: .github/setup-phpbb.sh $DB $PHP_VERSION $NOTESTS - working-directory: ./phpBB3 - - - name: Setup EPV - if: ${{ env.EPV != 0 }} - run: composer require phpbb/epv:dev-master --dev --no-interaction --ignore-platform-reqs - working-directory: ./phpBB3/phpBB - - - name: Run code sniffer - if: ${{ env.SNIFF != 0 }} - env: - NOTESTS: '1' - run: .github/ext-sniff.sh $EXTNAME $NOTESTS - working-directory: ./phpBB3 - - - name: Check image ICC profiles - if: ${{ env.IMAGE_ICC != 0 }} - run: .github/check-image-icc-profiles.sh - working-directory: ./phpBB3 - - - name: Check executable files - if: ${{ env.EXECUTABLE_FILES != 0 }} - run: .github/ext-check-executable-files.sh ./ $EXTNAME - working-directory: ./phpBB3 - - - name: Run EPV - if: ${{ env.EPV != 0 }} - run: phpBB/vendor/bin/EPV.php run --dir="phpBB/ext/$EXTNAME/" - working-directory: ./phpBB3 - # END Basic Checks Job - - # START MySQL and MariaDB Job - mysql-tests: - runs-on: ubuntu-22.04 - strategy: - matrix: - include: - - php: '7.2' - db: "mariadb:10.1" - - php: '7.2' - db: "mariadb:10.2" - - php: '7.2' - db: "mariadb:10.3" - - php: '7.2' - db: "mariadb:10.4" - - php: '7.2' - db: "mariadb:10.5" - - php: '7.2' - db: "mysql:5.6" - db_alias: "MyISAM Tests" - MYISAM: 1 - - php: '7.2' - db: "mysql:5.6" - - php: '7.2' - db: "mysql:5.7" - COVERAGE: 1 - db_alias: "mysql:5.7 with Coverage" - - php: '7.3' - db: "mysql:5.7" - - php: '7.4' - db: "mysql:5.7" - - php: '7.4' - db: "mysql:8.0" - - php: '8.0' - db: "mysql:5.7" - - php: '8.1' - db: "mysql:5.7" - - php: '8.2' - db: "mysql:5.7" - - php: '8.3' - db: "mysql:5.7" - - php: '8.4' - db: "mysql:5.7" - - name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} - - services: - mysql: - image: ${{ matrix.db }} - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: phpbb_tests - ports: - - 3306:3306 - options: >- - --health-cmd="mysqladmin ping" - --health-interval=10s - --health-timeout=5s - --health-retries=3 - - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Checkout phpBB - uses: actions/checkout@v4 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v4 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - id: database-type - env: - MATRIX_DB: ${{ matrix.db }} - run: | - db=$(echo "${MATRIX_DB%%:*}") - echo "db=$db" >> $GITHUB_OUTPUT - - - name: Setup PHP - if: ${{ matrix.COVERAGE != 1 }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap - coverage: none - - - name: Setup PHP with Coverage - if: ${{ matrix.COVERAGE == 1 }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap - coverage: xdebug - - - name: Setup environment for phpBB - env: - DB: ${{steps.database-type.outputs.db}} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '0' - run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} - working-directory: ./phpBB3 - - - name: Setup database - env: - DB: ${{steps.database-type.outputs.db}} - MYISAM: ${{ matrix.MYISAM != 1 && '0' || '1' }} - run: .github/setup-database.sh $DB $MYISAM - working-directory: ./phpBB3 - - - name: Setup PHPUnit files - env: - DB: ${{steps.database-type.outputs.db}} - COVERAGE: ${{ matrix.COVERAGE != 1 && '0' || '1' }} - run: | - if [ $COVERAGE == '1' ] - then - sed -n '1h;1!H;${;g;s/<\/php>/<\/php>\n\t\n\t\t\n\t\t\t..\/<\/directory>\n\t\t\t\n\t\t\t\t..\/tests\/<\/directory>\n\t\t\t\t..\/language\/<\/directory>\n\t\t\t\t..\/migrations\/<\/directory>\n\t\t\t<\/exclude>\n\t\t<\/whitelist>\n\t<\/filter>/g;p;}' .github/phpunit-$DB-github.xml &> phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml - else - mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ - fi - working-directory: ./phpBB3 - - - name: Run unit tests - env: - DB: ${{steps.database-type.outputs.db}} - COVERAGE: ${{ matrix.COVERAGE != 1 && '0' || '1' }} - run: | - if [ $COVERAGE == '1' ] - then - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml - else - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php - fi - working-directory: ./phpBB3 - - - name: Send code coverage - if: ${{ matrix.COVERAGE == 1 }} - uses: codecov/codecov-action@v3 - with: - files: ./phpBB3/build/logs/clover.xml - # END MySQL and MariaDB Job - - # START PostgreSQL Job - postgres-tests: - runs-on: ubuntu-22.04 - strategy: - matrix: - include: - - php: '7.2' - db: "postgres:9.5" - - php: '7.2' - db: "postgres:9.6" - - php: '7.2' - db: "postgres:10" - - php: '7.2' - db: "postgres:11" - - php: '7.2' - db: "postgres:12" - - php: '7.2' - db: "postgres:13" - - php: '7.3' - db: "postgres:13" - - php: '7.4' - db: "postgres:13" - - php: '8.0' - db: "postgres:12" - - php: '8.0' - db: "postgres:13" - - php: '8.1' - db: "postgres:14" - - php: '8.2' - db: "postgres:14" - - php: '8.3' - db: "postgres:14" - - php: '8.4' - db: "postgres:14" - - name: PHP ${{ matrix.php }} - ${{ matrix.db }} - - services: - postgres: - image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && 'postgres:10' || matrix.db }} - env: - POSTGRES_HOST: localhost - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - ports: - - 5432:5432 - options: >- - -v /var/run/postgresql:/var/run/postgresql - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Checkout phpBB - uses: actions/checkout@v4 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v4 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - id: database-type - env: - MATRIX_DB: ${{ matrix.db }} - run: | - db=$(echo "${MATRIX_DB%%:*}") - echo "db=$db" >> $GITHUB_OUTPUT - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap - coverage: none - - - name: Setup environment for phpBB - env: - DB: ${{steps.database-type.outputs.db}} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '0' - run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} - working-directory: ./phpBB3 - - - name: Setup database - env: - DB: ${{steps.database-type.outputs.db}} - MYISAM: '0' - run: .github/setup-database.sh $DB $MYISAM - working-directory: ./phpBB3 - - - name: Setup PHPUnit files - run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ - working-directory: ./phpBB3 - - - name: Run unit tests - env: - DB: ${{steps.database-type.outputs.db}} - run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php - working-directory: ./phpBB3 - # END PostgreSQL Job - - # START Other Tests Job (SQLite 3 and mssql) - other-tests: - runs-on: ubuntu-22.04 - strategy: - matrix: - include: - - php: '7.2' - db: "sqlite3" - - php: '7.2' - db: "mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04" - db_alias: 'MSSQL 2019' - - php: '7.2' - db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04" - db_alias: 'MSSQL 2022' - - name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} - - services: - mssql: - image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' && matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' || matrix.db }} - env: - SA_PASSWORD: "Pssw0rd_12" - ACCEPT_EULA: "y" - ports: - - 1433:1433 - options: >- - --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Pssw0rd_12' -Q \"Use [master]; CREATE DATABASE [phpbb_tests] COLLATE Latin1_General_CI_AS\" || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - --health-start-period 10s - - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 6379:6379 - - steps: - - name: Checkout phpBB - uses: actions/checkout@v4 - with: - repository: phpbb/phpbb - ref: ${{ env.PHPBB_BRANCH }} - path: phpBB3 - - - name: Checkout extension - uses: actions/checkout@v4 - with: - path: phpBB3/phpBB/ext/${{ env.EXTNAME }} - - - id: database-type - env: - MATRIX_DB: ${{ matrix.db }} - run: | - if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ] - then - db='mssql' - else - db=$(echo "${MATRIX_DB%%:*}") - fi - echo "db=$db" >> $GITHUB_OUTPUT - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap - coverage: none - - - name: Setup environment for phpBB - env: - DB: ${{steps.database-type.outputs.db}} - PHP_VERSION: ${{ matrix.php }} - NOTESTS: '0' - run: .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} - working-directory: ./phpBB3 - - - name: Setup database - env: - DB: ${{steps.database-type.outputs.db}} - MYISAM: '0' - run: .github/setup-database.sh $DB $MYISAM - working-directory: ./phpBB3 - - - name: Setup PHPUnit files - run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_ - working-directory: ./phpBB3 - - - name: Run unit tests - env: - DB: ${{steps.database-type.outputs.db}} - run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php - working-directory: ./phpBB3 - # END Other Tests Job + call-tests: + uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x + with: + EXTNAME: phpbb/googleanalytics # Your extension vendor/package name + SNIFF: 1 # Run code sniffer on your code? 1 or 0 + IMAGE_ICC: 1 # Run icc profile sniffer on your images? 1 or 0 + EPV: 1 # Run EPV (Extension Pre Validator) on your code? 1 or 0 + EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0 + CODECOV: 1 # Run code coverage via codecov? 1 or 0 + PHPBB_BRANCH: 3.3.x # The phpBB branch to run tests on + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Do not change this From 2e156619fe739c6a7cc8997d5ba4f31f4f6bd21f Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 6 May 2025 14:55:03 -0700 Subject: [PATCH 08/10] Update tests.yml --- .github/workflows/tests.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 33a073b..e98d76c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,14 +16,10 @@ on: jobs: call-tests: + name: Extension tests uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x with: - EXTNAME: phpbb/googleanalytics # Your extension vendor/package name - SNIFF: 1 # Run code sniffer on your code? 1 or 0 - IMAGE_ICC: 1 # Run icc profile sniffer on your images? 1 or 0 - EPV: 1 # Run EPV (Extension Pre Validator) on your code? 1 or 0 - EXECUTABLE_FILES: 1 # Run check for executable files? 1 or 0 - CODECOV: 1 # Run code coverage via codecov? 1 or 0 - PHPBB_BRANCH: 3.3.x # The phpBB branch to run tests on + EXTNAME: phpbb/googleanalytics # Your extension vendor/package name + CODECOV: 1 # Run code coverage via codecov? 1 or 0 secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Do not change this From f1d39a3fabe1787273c6a3bc4d7cf49131981252 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sun, 25 May 2025 07:57:39 -0700 Subject: [PATCH 09/10] Update .gitattributes [ci skip] --- .gitattributes | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitattributes b/.gitattributes index 15e367d..490d0e7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,7 @@ -tests/ export-ignore -travis/ export-ignore -.github/ export-ignore -.travis.yml export-ignore +.github export-ignore .gitignore export-ignore .gitattributes export-ignore -phpunit.xml.* export-ignore -composer.lock export-ignore build.xml export-ignore +composer.lock export-ignore +phpunit.xml.* export-ignore +tests export-ignore From ef00c0ad9869e890a9316fe774efa1dbfa492d5b Mon Sep 17 00:00:00 2001 From: Jan Wille Date: Fri, 13 Feb 2026 21:55:52 +0100 Subject: [PATCH 10/10] Changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2477b4..7ef00c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.0.7 - 2026-01-13 + +- sync version with upstream +- merge new testing setup + ## 1.0.0 - 2022-03-10 - changed all names to matomo