Skip to content

Commit 708c648

Browse files
TatevikGrtatevikg1
andauthored
use api php8.1 version (#1059)
* ISSUE-337: use api php8.1 version * ISSUE-337: ci * do not fail on experimental versions --------- Co-authored-by: Tatevik <[email protected]>
1 parent edbdc4f commit 708c648

File tree

3 files changed

+50
-53
lines changed

3 files changed

+50
-53
lines changed

.github/workflows/build-release.yml

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
21
name: Build Release
32

43
on:
54
push:
65
tags: v[1-9]+.[0-9]+.*
76

8-
97
jobs:
108
test:
119
runs-on: ubuntu-22.04
1210
continue-on-error: ${{ matrix.experimental }}
1311

1412
strategy:
15-
fail-fast: false
16-
matrix:
13+
fail-fast: false
14+
matrix:
1715
php-version: ['8.2']
1816
experimental: [false]
1917

2018
steps:
21-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2220

2321
- name: Find the version
2422
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
@@ -43,7 +41,7 @@ jobs:
4341
sudo apt update && sudo apt install -y rsync
4442
4543
- name: Cache Composer dependencies
46-
uses: actions/cache@v2
44+
uses: actions/cache@v3
4745
with:
4846
path: /tmp/composer-cache
4947
key: ${{ matrix.php-version }}-${{ env.RELEASE_VERSION }}-${{ hashFiles('**/composer.lock') }}
@@ -54,7 +52,7 @@ jobs:
5452
dev: yes
5553
args: --prefer-dist --no-interaction
5654
php_version: ${{ matrix.php-version }}
57-
php_extensions: xml
55+
php_extensions: xml
5856
version: 2
5957

6058
- name: Install Plugins and Themes
@@ -67,10 +65,10 @@ jobs:
6765
run: |
6866
cd $GITHUB_WORKSPACE
6967
cd public_html/lists
70-
wget https://github.com/phpList/base-distribution/archive/refs/heads/phplist3.zip
71-
unzip phplist3.zip
72-
rm phplist3.zip
73-
mv base-distribution-phplist3 base
68+
wget https://github.com/phpList/base-distribution/archive/refs/heads/main.zip
69+
unzip main.zip
70+
rm main.zip
71+
mv base-distribution-main base
7472
cd base
7573
composer update --no-dev
7674
@@ -97,7 +95,7 @@ jobs:
9795
with:
9896
path: ./public_html
9997
options: --exclude=base/vendor
100-
98+
10199
- name: Report Versions
102100
run: |
103101
google-chrome --version
@@ -121,7 +119,7 @@ jobs:
121119
122120
- name: Upload the screenshots
123121
if: always()
124-
uses: actions/upload-artifact@v2
122+
uses: actions/upload-artifact@v3
125123
with:
126124
path: "output"
127125
name: "behat output"
@@ -220,24 +218,24 @@ jobs:
220218
221219
- name: Upload the package as artifact
222220
if: always()
223-
uses: actions/upload-artifact@v2
221+
uses: actions/upload-artifact@v3
224222
with:
225223
path: "phplist-*.tgz"
226224
name: "phpList Release File"
227225
retention-days: 3
228226

229227
- name: Set up Docker Buildx
230-
uses: docker/setup-buildx-action@v1
228+
uses: docker/setup-buildx-action@v2
231229

232230
- name: Login to DockerHub
233-
uses: docker/login-action@v1
231+
uses: docker/login-action@v2
234232
with:
235233
username: ${{ secrets.DOCKERHUB_USERNAME }}
236234
password: ${{ secrets.DOCKERHUB_TOKEN }}
237235

238236
- name: Build and push
239237
id: docker_build
240-
uses: docker/build-push-action@v2
238+
uses: docker/build-push-action@v3
241239
with:
242240
context: .
243241
push: true

.github/workflows/main.yml

+34-35
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ jobs:
99
continue-on-error: ${{ matrix.experimental }}
1010

1111
strategy:
12-
fail-fast: false
13-
matrix:
14-
php-version: ['7.4', '8.0', '8.1','8.2']
12+
fail-fast: false
13+
matrix:
14+
php-version: ['7.4', '8.0', '8.1', '8.2']
1515
experimental: [false]
1616
include:
17-
- php-version: 8.3
17+
- php-version: '8.3'
1818
experimental: true
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
2222

2323
- name: Set up PHP ${{ matrix.php-version }}
2424
uses: shivammathur/setup-php@v2
@@ -29,24 +29,17 @@ jobs:
2929

3030
- name: Setup Packages
3131
run: |
32-
cd $GITHUB_WORKSPACE
3332
sudo apt update
34-
sudo apt install rsync
35-
36-
# - name: Cache Composer dependencies
37-
# uses: actions/cache@v2
38-
# with:
39-
# path: /tmp/composer-cache
40-
# key: ${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
33+
sudo apt install -y rsync
4134
4235
- name: Install dependencies
4336
uses: php-actions/composer@v6
4437
with:
4538
dev: yes
4639
args: --prefer-dist --no-interaction
4740
php_version: ${{ matrix.php-version }}
48-
php_extensions: xml
49-
version: 2
41+
php_extensions: xml
42+
continue-on-error: ${{ matrix.experimental }}
5043

5144
- name: Report Versions
5245
run: |
@@ -61,69 +54,75 @@ jobs:
6154
vendor/bin/behat -V
6255
mysql --version
6356
mysqladmin --version
57+
continue-on-error: ${{ matrix.experimental }}
6458

6559
- name: Create Database
6660
run: |
6761
sudo systemctl start mysql.service
68-
sudo mysql -proot -e 'drop database if exists phplistdb'
62+
sudo mysql -proot -e 'DROP DATABASE IF EXISTS phplistdb'
6963
sudo mysqladmin -proot create phplistdb
70-
sudo mysql -proot -e 'create user phplist@"%" identified by "phplist"; grant all on phplistdb.* to phplist@"%"'
64+
sudo mysql -proot -e 'CREATE USER phplist@"%" IDENTIFIED BY "phplist"; GRANT ALL ON phplistdb.* TO phplist@"%"'
65+
continue-on-error: ${{ matrix.experimental }}
7166

72-
- name: Set bootlist theme
67+
- name: Set Bootlist Theme
7368
run: |
74-
cd $GITHUB_WORKSPACE/public_html/lists/admin/ui/
69+
cd public_html/lists/admin/ui/
7570
wget https://github.com/phpList/phplist-ui-bootlist/archive/master.tar.gz
7671
tar -xzf master.tar.gz
7772
mv phplist-ui-bootlist-master phplist-ui-bootlist
7873
rm master.tar.gz
74+
continue-on-error: ${{ matrix.experimental }}
7975

8076
- name: Start Test Server
8177
run: |
82-
cd $GITHUB_WORKSPACE
8378
cp -fv tests/ci/behat.yml tests/behat.yml
8479
cp -fv tests/ci/config.php public_html/lists/config/config.php
8580
mkdir -p output/screenshots
86-
touch output/screenshots/README.md
8781
mkdir -p build/mails
8882
./bin/start-selenium > output/selenium.log 2>&1 &
8983
sleep 5
9084
sudo php -S 0.0.0.0:80 -t public_html > /dev/null 2>&1 &
85+
continue-on-error: ${{ matrix.experimental }}
9186

9287
- name: Check PHP syntax errors
9388
uses: overtrue/[email protected]
9489
with:
9590
path: ./public_html
96-
91+
continue-on-error: ${{ matrix.experimental }}
92+
9793
- name: Run BDD Tests UI
9894
run: |
99-
cd $GITHUB_WORKSPACE/tests
95+
cd tests
10096
../vendor/bin/behat -p chrome -f progress --stop-on-failure --tags=@initialise
10197
../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip"
98+
continue-on-error: ${{ matrix.experimental }}
10299

103100
- name: Run BDD Tests CLI
104101
run: |
105-
cd $GITHUB_WORKSPACE
106102
107103
export ADMIN_PASSWORD=Mypassword123+
108104
export ORGANISATION_NAME="phpList"
109105
export ADMIN_NAME="phpList Administrator"
110-
php public_html/lists/admin/index.php -c $GITHUB_WORKSPACE/public_html/lists/config/config.php -p initialise -f
111-
cd $GITHUB_WORKSPACE/tests
106+
php public_html/lists/admin/index.php -c public_html/lists/config/config.php -p initialise -f
107+
cd tests
112108
../vendor/bin/behat -p chrome --tags="~@initialise && ~@wip"
109+
continue-on-error: ${{ matrix.experimental }}
110+
111+
- name: Handle Experimental Warnings
112+
if: ${{ matrix.experimental && failure() }}
113+
run: |
114+
echo "::warning::PHP ${matrix.php-version} tests failed. This is marked as experimental and does not impact overall workflow success."
113115
114-
- name: Upload the screenshots
116+
- name: Upload the Screenshots
115117
if: always()
116-
uses: actions/upload-artifact@v2
118+
uses: actions/upload-artifact@v3
117119
with:
118120
path: "output"
119121
name: "behat output ${{ matrix.php-version }}"
120122
retention-days: 3
121123

122-
- name: Display output
124+
- name: Display Output on Failure
125+
if: failure() && !matrix.experimental
123126
run: |
124-
cd $GITHUB_WORKSPACE
125-
# find . -type f
126-
# cat output/selenium.log
127-
if: ${{ failure() }}
128-
129-
127+
find . -type f
128+
cat output/selenium.log

public_html/lists/api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use PhpList\Core\Core\Bootstrap;
44

5-
if (version_compare(phpversion(), '7.0.0', '<')) {
5+
if (version_compare(phpversion(), '8.1', '<')) {
66
die('API is not supported on this PHP version.');
77
}
88
require_once __DIR__ . '/base/vendor/autoload.php';

0 commit comments

Comments
 (0)