Skip to content

Commit

Permalink
Merge branch 'master' into dev/4.0
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Friedman <[email protected]>

# Conflicts:
#	.github/workflows/tests.yml
  • Loading branch information
iMattPro committed Feb 22, 2024
2 parents ade2f74 + 7f4ec1c commit 0ea7b0b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fixes:
- "/phpBB3/phpBB/ext/phpbb/pages/::"
37 changes: 35 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ jobs:
MYISAM: 1
- php: '8.1'
db: "mysql:8.0"
COVERAGE: 1
db_alias: "mysql:8.0 with Coverage"
- php: '8.1'
db: "mysql:8.1"
- php: '8.2'
Expand Down Expand Up @@ -173,12 +175,21 @@ jobs:
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, intl, gd, exif, iconv, mysqli, pdo, pdo_mysql, 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, intl, gd, exif, iconv, mysqli, pdo, pdo_mysql, ldap
coverage: xdebug

- name: Setup environment for phpBB
env:
DB: ${{steps.database-type.outputs.db}}
Expand All @@ -195,14 +206,36 @@ jobs:
working-directory: ./phpBB3

- name: Setup PHPUnit files
run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_
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<filter>\n\t\t<whitelist>\n\t\t\t<directory>..\/<\/directory>\n\t\t\t<exclude>\n\t\t\t\t<directory>..\/tests\/<\/directory>\n\t\t\t\t<directory>..\/language\/<\/directory>\n\t\t\t\t<directory>..\/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}}
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This is the repository for the development of the phpBB Pages Extension.

[![Build Status](https://github.com/phpbb-extensions/pages/workflows/Tests/badge.svg)](https://github.com/phpbb-extensions/pages/actions)
[![codecov](https://codecov.io/gh/phpbb-extensions/pages/graph/badge.svg?token=rorlx9l6gs)](https://codecov.io/gh/phpbb-extensions/pages)

## Install

Expand Down
6 changes: 3 additions & 3 deletions acp/pages_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public function main($id, $mode)
$this->tpl_name = 'manage_pages';

// Set the page title for our ACP page
$this->page_title = $lang->lang('ACP_PAGES_MANAGE');
$this->page_title = 'ACP_PAGES_MANAGE';

// Perform any actions submitted by the user
switch ($action)
{
case 'add':
// Set the page title for our ACP page
$this->page_title = $lang->lang('ACP_PAGES_CREATE_PAGE');
$this->page_title = 'ACP_PAGES_CREATE_PAGE';

// Load the add page handle in the admin controller
$admin_controller->add_page();
Expand All @@ -71,7 +71,7 @@ public function main($id, $mode)

case 'edit':
// Set the page title for our ACP page
$this->page_title = $lang->lang('ACP_PAGES_EDIT_PAGE');
$this->page_title = 'ACP_PAGES_EDIT_PAGE';

// Load the edit page handle in the admin controller
$admin_controller->edit_page($page_id);
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"version-check": {
"host": "www.phpbb.com",
"directory": "/customise/db/extension/pages",
"filename": "version_check"
"filename": "version_check",
"ssl": true
}
}
}

0 comments on commit 0ea7b0b

Please sign in to comment.