update ckeditor5 plugin (#1088) #874
This file contains hidden or 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
name: CI | |
on: [pull_request, push] | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: ['8.1', '8.2', '8.3'] | |
experimental: [false] | |
unsupported: [false] | |
include: | |
- php-version: '7.4' | |
unsupported: true | |
experimental: false | |
- php-version: '8.0' | |
unsupported: true | |
experimental: false | |
- php-version: '8.4' | |
unsupported: false | |
experimental: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up PHP ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
env: | |
COMPOSER_TOKEN: ${{ secrets.COMPOSER_TOKEN }} | |
- name: Setup Packages | |
run: | | |
sudo apt update | |
sudo apt -y install rsync postfix | |
- name: Install dependencies | |
uses: php-actions/composer@v6 | |
with: | |
dev: yes | |
args: --prefer-dist --no-interaction | |
php_version: ${{ matrix.php-version }} | |
php_extensions: xml | |
continue-on-error: ${{ matrix.experimental }} | |
- name: Report Versions | |
run: | | |
google-chrome --version | |
lsb_release -a | |
php -v | |
chromedriver -v | |
geckodriver -V | |
which geckodriver | |
which chromedriver | |
firefox -v | |
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; create database phplistdb;' | |
sudo mysql -proot -e 'create user phplist@"%" identified by "phplist"; grant all on phplistdb.* to phplist@"%"' | |
- name: Set Bootlist Theme | |
run: | | |
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: Install the phpList4 based REST API | |
run: | | |
cd $GITHUB_WORKSPACE | |
cd public_html/lists | |
wget https://github.com/phpList/base-distribution/archive/refs/heads/main.zip | |
unzip main.zip | |
rm main.zip | |
mv base-distribution-main base | |
cd base | |
composer update --no-dev | |
if: ${{ matrix.unsupported == false }} | |
- name: Start Test Server | |
run: | | |
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 | |
mkdir -p /tmp/screenshots/ | |
touch output/screenshots/README.md | |
mkdir -p output/mails | |
smtp-sink -c -d "output/mails/%Y%m%d%H/%M." 2500 1024 & | |
./bin/start-selenium > output/selenium.log 2>&1 & | |
sleep 15 | |
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/phplint@3.0.0 | |
with: | |
path: ./public_html | |
options: --exclude=lists/base | |
if: ${{ matrix.unsupported == false }} | |
continue-on-error: ${{ matrix.experimental }} | |
- name: Check PHP syntax errors in API | |
uses: overtrue/phplint@9.5.0 | |
with: | |
path: ./public_html/lists/base/vendor/phplist | |
if: ${{ matrix.unsupported == false }} | |
continue-on-error: ${{ matrix.experimental }} | |
- name: Run BDD Tests UI | |
run: | | |
cd tests | |
../vendor/bin/behat -p chrome -f progress --stop-on-failure --tags=@initialise | |
../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip && ~@behattest" | |
continue-on-error: ${{ matrix.experimental }} | |
- name: Run BDD Tests CLI | |
run: | | |
export ADMIN_EMAIL=admin@phplist.dev | |
export ADMIN_PASSWORD=Mypassword123+ | |
export ORGANISATION_NAME="phpList" | |
export ADMIN_NAME="phpList Administrator" | |
php public_html/lists/admin/index.php -c public_html/lists/config/config.php -p initialise -f | |
cd tests | |
../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip" | |
continue-on-error: ${{ matrix.experimental }} | |
- name: copy screenshots | |
if: always() | |
run: | | |
cd $GITHUB_WORKSPACE | |
images=$(ls -l /tmp/*.png 2>/dev/null | wc -l) | |
[[ $images -gt 0 ]] && cp -v /tmp/*.png output/screenshots | |
exit 0; | |
- 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 | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
path: "/tmp/screenshots/" | |
name: "screenshots ${{ matrix.php-version }}" | |
retention-days: 3 | |
- name: Upload the Selenium Logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
path: "output/selenium.log" | |
name: "selenium log ${{ matrix.php-version }}" | |
retention-days: 3 |