Skip to content

Commit

Permalink
Merge pull request #177 from iMattPro/updates
Browse files Browse the repository at this point in the history
testing updates
  • Loading branch information
iMattPro authored May 12, 2023
2 parents 618baa7 + cc104db commit a6e49c4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 18 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ on:
jobs:
# START Basic Checks Job (EPV, code sniffer, images check, etc.)
basic-checks:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- php: '7.1'
- php: '7.2'
db: "none"
NOTESTS: 1

name: PHP ${{ matrix.php }} - ${{ matrix.db }}

steps:
- name: Checkout phpBB
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: phpbb/phpbb
ref: ${{ env.PHPBB_BRANCH }}
path: phpBB3

- name: Checkout extension
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: phpBB3/phpBB/ext/${{ env.EXTNAME }}

Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:

# START MySQL and MariaDB Job
mysql-tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
include:
Expand Down Expand Up @@ -123,6 +123,8 @@ jobs:
db: "mysql:5.7"
- php: '8.1'
db: "mysql:5.7"
- php: '8.2'
db: "mysql:5.7"

name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}

Expand Down Expand Up @@ -152,14 +154,14 @@ jobs:

steps:
- name: Checkout phpBB
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: phpbb/phpbb
ref: ${{ env.PHPBB_BRANCH }}
path: phpBB3

- name: Checkout extension
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: phpBB3/phpBB/ext/${{ env.EXTNAME }}

Expand All @@ -168,7 +170,7 @@ jobs:
MATRIX_DB: ${{ matrix.db }}
run: |
db=$(echo "${MATRIX_DB%%:*}")
echo "::set-output name=db::$db"
echo "db=$db" >> $GITHUB_OUTPUT
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -205,7 +207,7 @@ jobs:

# START PostgreSQL Job
postgres-tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
include:
Expand All @@ -221,6 +223,20 @@ jobs:
db: "postgres:12"
- php: '7.1'
db: "postgres:13"
- 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"

name: PHP ${{ matrix.php }} - ${{ matrix.db }}

Expand Down Expand Up @@ -252,14 +268,14 @@ jobs:

steps:
- name: Checkout phpBB
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: phpbb/phpbb
ref: ${{ env.PHPBB_BRANCH }}
path: phpBB3

- name: Checkout extension
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: phpBB3/phpBB/ext/${{ env.EXTNAME }}

Expand All @@ -268,7 +284,7 @@ jobs:
MATRIX_DB: ${{ matrix.db }}
run: |
db=$(echo "${MATRIX_DB%%:*}")
echo "::set-output name=db::$db"
echo "db=$db" >> $GITHUB_OUTPUT
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -305,7 +321,7 @@ jobs:

# START Other Tests Job (SQLite 3 and mssql)
other-tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
include:
Expand Down Expand Up @@ -347,14 +363,14 @@ jobs:

steps:
- name: Checkout phpBB
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: phpbb/phpbb
ref: ${{ env.PHPBB_BRANCH }}
path: phpBB3

- name: Checkout extension
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: phpBB3/phpBB/ext/${{ env.EXTNAME }}

Expand All @@ -368,7 +384,7 @@ jobs:
else
db=$(echo "${MATRIX_DB%%:*}")
fi
echo "::set-output name=db::$db"
echo "db=$db" >> $GITHUB_OUTPUT
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Pages can convert/import data from [Static Pages MOD 1.0.3](https://www.phpbb.co
Note: Pages will keep a backup of the Static Pages MOD data in a database table named `pages_mod_backup`. Pages will never delete or alter this backup table. Pages has not been tested with any other similar MODs.

## License
[GNU General Public License v2](http://opensource.org/licenses/GPL-2.0)
[GNU General Public License v2](https://opensource.org/licenses/GPL-2.0)
1 change: 1 addition & 0 deletions controller/main_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function display($route)
));

// Send all data to the template file
// We do not use @phpbb_pages to allow templates from outside the extension
return $this->helper->render($page->get_template(), $page_title);
}

Expand Down
2 changes: 1 addition & 1 deletion entity/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public function set_order($order)
*/
public function get_template()
{
return (!empty($this->data['page_template'])) ? (string) $this->data['page_template'] : 'pages_default.html';
return !empty($this->data['page_template']) ? (string) $this->data['page_template'] : 'pages_default.html';
}

/**
Expand Down

0 comments on commit a6e49c4

Please sign in to comment.