Skip to content

Commit 8bdb3b2

Browse files
authored
consider an installer superuser and handle PHP8 better (#777)
* consider an installer superuser and handle PHP8 better * bring home.php from theme into the application * treat installer as superuser * update bootlist theme to latest * remove step that's failing * mark menu as wip, as it's failing * update the behat screenshots on failure * run more steps on failure * work from correct folder * remove wip, it's not the cause * debug * add / * mark feature as javascript * use a working location for screenshots * set the output dir * use different extension * try debugging on self-hosted runner * don't use FailAid extension * roll back self-hosted * add script to get composer 2 * why are the screenshots not there * check find result works * try goutte * check FF * use chrome and keep behat output as artifact
1 parent a2f92c6 commit 8bdb3b2

File tree

9 files changed

+356
-539
lines changed

9 files changed

+356
-539
lines changed

.github/workflows/main.yml

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
name: CI
33

4-
on: [push, pull_request]
4+
on: [pull_request]
55

66
jobs:
77
test:
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
php-version: ['7.2', '7.3', '7.4']
14+
php-version: ['7.2', '7.2', '7.3', '7.4']
1515
experimental: [false]
1616
include:
1717
- php-version: '8.0'
@@ -31,6 +31,7 @@ jobs:
3131
run: |
3232
cd $GITHUB_WORKSPACE
3333
sudo apt update
34+
sudo apt install rsync
3435
3536
- name: Cache Composer dependencies
3637
uses: actions/cache@v2
@@ -57,20 +58,21 @@ jobs:
5758
sudo mysqladmin -proot create phplistdb
5859
sudo mysql -proot -e 'grant all on phplistdb.* to phplist@"%" identified by "phplist"'
5960
60-
# - name: Set bootlist theme
61-
# run: |
62-
# cd $GITHUB_WORKSPACE/public_html/lists/admin/ui/
63-
# wget https://github.com/phpList/phplist-ui-bootlist/archive/master.tar.gz
64-
# tar -xzf master.tar.gz
65-
# mv phplist-ui-bootlist-master phplist-ui-bootlist
66-
# rm master.tar.gz
61+
- name: Set bootlist theme
62+
run: |
63+
cd $GITHUB_WORKSPACE/public_html/lists/admin/ui/
64+
wget https://github.com/phpList/phplist-ui-bootlist/archive/master.tar.gz
65+
tar -xzf master.tar.gz
66+
mv phplist-ui-bootlist-master phplist-ui-bootlist
67+
rm master.tar.gz
6768
6869
- name: Start Test Server
6970
run: |
7071
cd $GITHUB_WORKSPACE
7172
cp -fv tests/default.behat.yml tests/behat.yml
7273
cp -fv tests/ci/config.php public_html/lists/config/config.php
7374
mkdir -p output/screenshots
75+
touch output/screenshots/README.md
7476
mkdir -p build/mails
7577
./bin/start-selenium > output/selenium.log 2>&1 &
7678
sleep 5
@@ -81,26 +83,36 @@ jobs:
8183
with:
8284
path: ./public_html
8385

84-
# - name: Report Versions
85-
# run: |
86-
# google-chrome --version
87-
# php -v
88-
# chromedriver -v
89-
# geckodriver -V
90-
# which geckodriver
91-
# which chromedriver
92-
# firefox -v
93-
# vendor/bin/behat -V
86+
- name: Report Versions
87+
run: |
88+
google-chrome --version
89+
php -v
90+
chromedriver -v
91+
geckodriver -V
92+
which geckodriver
93+
which chromedriver
94+
firefox -v
95+
vendor/bin/behat -V
9496
9597
- name: Run BDD Tests
9698
run: |
9799
cd $GITHUB_WORKSPACE/tests
98-
../vendor/bin/behat -n -fprogress -p chrome --strict --stop-on-failure --tags=@initialise
99-
../vendor/bin/behat -n -fprogress -p chrome --strict --stop-on-failure --tags="~@initialise && ~@wip"
100+
../vendor/bin/behat -p chrome --stop-on-failure --tags=@initialise
101+
../vendor/bin/behat -p chrome --tags="~@initialise && ~@wip"
102+
103+
- name: Upload the screenshots
104+
if: always()
105+
uses: actions/upload-artifact@v2
106+
with:
107+
path: "output"
108+
name: "behat output"
109+
retention-days: 3
100110

101111
- name: Display output
102112
run: |
103113
cd $GITHUB_WORKSPACE
104-
cat output/selenium.log
114+
# find . -type f
115+
# cat output/selenium.log
116+
if: ${{ failure() }}
105117

106118

bin/update-composer.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
4+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
5+
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
6+
7+
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
8+
then
9+
>&2 echo 'ERROR: Invalid installer checksum'
10+
rm composer-setup.php
11+
exit 1
12+
fi
13+
echo installing composer
14+
php composer-setup.php --quiet
15+
RESULT=$?
16+
rm composer-setup.php
17+
exit $RESULT

0 commit comments

Comments
 (0)