4141 working-directory : app
4242 run : npm run build:test
4343
44+ - name : Generate SSL certificates
45+ working-directory : app
46+ run : |
47+ mkdir ./ssl
48+ openssl req -x509 -nodes \
49+ -days 365 \
50+ -newkey rsa:2048 \
51+ -keyout ./ssl/certificate.key \
52+ -out ./ssl/certificate.crt \
53+ -subj="/O=Moodle"
54+
4455 - name : Build Behat plugin
4556 working-directory : app
4657 run : ./scripts/build-behat-plugin.js ../plugin
@@ -111,11 +122,12 @@ jobs:
111122
112123 - uses : actions/cache/save@v4
113124 with :
114- key : build-${{ github.sha }}
115- path : |
116- app/node_modules/**/*
117- app/www/**/*
118- plugin/**/*
125+ key : build-${{ github.sha }}
126+ path : |
127+ app/ssl/**/*
128+ app/node_modules/**/*
129+ app/www/**/*
130+ plugin/**/*
119131
120132 behat :
121133 runs-on : ubuntu-latest
@@ -157,23 +169,33 @@ jobs:
157169 with :
158170 key : build-${{ github.sha }}
159171 path : |
172+ app/ssl/**/*
160173 app/node_modules/**/*
161174 app/www/**/*
162175 plugin/**/*
163176
164177 - name : Launch Docker images
165178 working-directory : app
166179 run : |
167- docker run -d --rm -p 8001:80 --name moodleapp -v ./www:/usr/share/nginx/html -v ./nginx.conf:/etc/nginx/conf.d/default.conf nginx:alpine
180+ docker run -d --rm \
181+ -p 8001:443 \
182+ --name moodleapp \
183+ -v ./www:/usr/share/nginx/html \
184+ -v ./nginx.conf:/etc/nginx/conf.d/default.conf \
185+ -v ./ssl/certificate.crt:/etc/ssl/certificate.crt \
186+ -v ./ssl/certificate.key:/etc/ssl/certificate.key \
187+ nginx:alpine
168188 docker run -d --rm -p 8002:80 --name bigbluebutton moodlehq/bigbluebutton_mock:latest
169189
170190 - name : Initialise moodle-plugin-ci
171191 run : |
172- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4.3
192+ git clone https://github.com/NoelDeMartin/moodle-plugin-ci --branch selenium-env ci
193+ composer install -d ./ci
173194 echo $(cd ci/bin; pwd) >> $GITHUB_PATH
174195 echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
175196 sudo locale-gen en_AU.UTF-8
176197 echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
198+ sed -i "58i\$CFG->behat_profiles['chrome']['capabilities'] = ['extra_capabilities' => ['chromeOptions' => ['args' => ['--ignore-certificate-errors', '--allow-running-insecure-content']]]];" ci/res/template/config.php.txt
177199
178200 - name : Install Behat Snapshots plugin
179201 run : moodle-plugin-ci add-plugin NoelDeMartin/moodle-local_behatsnapshots
@@ -184,7 +206,7 @@ jobs:
184206 DB : pgsql
185207 MOODLE_BRANCH : ${{ github.event.inputs.moodle_branch || 'main' }}
186208 MOODLE_REPO : ${{ github.event.inputs.moodle_repository || 'https://github.com/moodle/moodle.git' }}
187- MOODLE_BEHAT_IONIC_WWWROOT : http ://localhost:8001
209+ MOODLE_BEHAT_IONIC_WWWROOT : https ://localhost:8001
188210 MOODLE_BEHAT_DEFAULT_BROWSER : chrome
189211
190212 - name : Update config
@@ -194,6 +216,7 @@ jobs:
194216 run : moodle-plugin-ci behat --auto-rerun 3 --profile chrome --tags="@app&&~@local&&$BEHAT_TAGS"
195217 env :
196218 BEHAT_TAGS : ${{ matrix.tags }}
219+ MOODLE_BEHAT_SELENIUM_IMAGE : selenium/standalone-chrome:120.0
197220
198221 - name : Upload Snapshot failures
199222 uses : actions/upload-artifact@v4
0 commit comments