-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ISSUE-337: use api php8.1 version * ISSUE-337: ci * do not fail on experimental versions --------- Co-authored-by: Tatevik <[email protected]>
- Loading branch information
Showing
3 changed files
with
50 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,16 +9,16 @@ jobs: | |
continue-on-error: ${{ matrix.experimental }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['7.4', '8.0', '8.1','8.2'] | ||
fail-fast: false | ||
matrix: | ||
php-version: ['7.4', '8.0', '8.1', '8.2'] | ||
experimental: [false] | ||
include: | ||
- php-version: 8.3 | ||
- php-version: '8.3' | ||
experimental: true | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up PHP ${{ matrix.php-version }} | ||
uses: shivammathur/setup-php@v2 | ||
|
@@ -29,24 +29,17 @@ jobs: | |
|
||
- name: Setup Packages | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
sudo apt update | ||
sudo apt install rsync | ||
# - name: Cache Composer dependencies | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: /tmp/composer-cache | ||
# key: ${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} | ||
sudo apt install -y rsync | ||
- name: Install dependencies | ||
uses: php-actions/composer@v6 | ||
with: | ||
dev: yes | ||
args: --prefer-dist --no-interaction | ||
php_version: ${{ matrix.php-version }} | ||
php_extensions: xml | ||
version: 2 | ||
php_extensions: xml | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
- name: Report Versions | ||
run: | | ||
|
@@ -61,69 +54,75 @@ jobs: | |
vendor/bin/behat -V | ||
mysql --version | ||
mysqladmin --version | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
- name: Create Database | ||
run: | | ||
sudo systemctl start mysql.service | ||
sudo mysql -proot -e 'drop database if exists phplistdb' | ||
sudo mysql -proot -e 'DROP DATABASE IF EXISTS phplistdb' | ||
sudo mysqladmin -proot create phplistdb | ||
sudo mysql -proot -e 'create user phplist@"%" identified by "phplist"; grant all on phplistdb.* to phplist@"%"' | ||
sudo mysql -proot -e 'CREATE USER phplist@"%" IDENTIFIED BY "phplist"; GRANT ALL ON phplistdb.* TO phplist@"%"' | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
- name: Set bootlist theme | ||
- name: Set Bootlist Theme | ||
run: | | ||
cd $GITHUB_WORKSPACE/public_html/lists/admin/ui/ | ||
cd public_html/lists/admin/ui/ | ||
wget https://github.com/phpList/phplist-ui-bootlist/archive/master.tar.gz | ||
tar -xzf master.tar.gz | ||
mv phplist-ui-bootlist-master phplist-ui-bootlist | ||
rm master.tar.gz | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
- name: Start Test Server | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
cp -fv tests/ci/behat.yml tests/behat.yml | ||
cp -fv tests/ci/config.php public_html/lists/config/config.php | ||
mkdir -p output/screenshots | ||
touch output/screenshots/README.md | ||
mkdir -p build/mails | ||
./bin/start-selenium > output/selenium.log 2>&1 & | ||
sleep 5 | ||
sudo php -S 0.0.0.0:80 -t public_html > /dev/null 2>&1 & | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
- name: Check PHP syntax errors | ||
uses: overtrue/[email protected] | ||
with: | ||
path: ./public_html | ||
|
||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
- name: Run BDD Tests UI | ||
run: | | ||
cd $GITHUB_WORKSPACE/tests | ||
cd tests | ||
../vendor/bin/behat -p chrome -f progress --stop-on-failure --tags=@initialise | ||
../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip" | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
- name: Run BDD Tests CLI | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
export [email protected] | ||
export ADMIN_PASSWORD=Mypassword123+ | ||
export ORGANISATION_NAME="phpList" | ||
export ADMIN_NAME="phpList Administrator" | ||
php public_html/lists/admin/index.php -c $GITHUB_WORKSPACE/public_html/lists/config/config.php -p initialise -f | ||
cd $GITHUB_WORKSPACE/tests | ||
php public_html/lists/admin/index.php -c public_html/lists/config/config.php -p initialise -f | ||
cd tests | ||
../vendor/bin/behat -p chrome --tags="~@initialise && ~@wip" | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
- name: Handle Experimental Warnings | ||
if: ${{ matrix.experimental && failure() }} | ||
run: | | ||
echo "::warning::PHP ${matrix.php-version} tests failed. This is marked as experimental and does not impact overall workflow success." | ||
- name: Upload the screenshots | ||
- name: Upload the Screenshots | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: "output" | ||
name: "behat output ${{ matrix.php-version }}" | ||
retention-days: 3 | ||
|
||
- name: Display output | ||
- name: Display Output on Failure | ||
if: failure() && !matrix.experimental | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
# find . -type f | ||
# cat output/selenium.log | ||
if: ${{ failure() }} | ||
|
||
|
||
find . -type f | ||
cat output/selenium.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters