Test/try fix #25
Workflow file for this run
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: Cypress Tests | |
on: | |
pull_request: | |
jobs: | |
cypress-tests: | |
name: Cypress Tests | |
runs-on: ubuntu-latest | |
strategy: | |
# when one test fails, DO NOT cancel the other | |
# containers, because this will kill Cypress processes | |
# leaving the Dashboard hanging ... | |
# https://github.com/cypress-io/github-action/issues/48 | |
fail-fast: false | |
matrix: | |
containers: [1, 2, 3] # number of parallel containers | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
# test the lowest version, to make sure checks pass on it | |
php-version: 8.0 | |
extensions: json, mbstring, pdo, curl, pdo_sqlite | |
coverage: none | |
tools: composer | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 12.22 | |
# See https://github.community/t/sudo-apt-install-fails-with-failed-to-fetch-http-security-ubuntu-com-404-not-found-ip/17075 | |
- run: | | |
sudo apt update | |
- name: Symfony cli installation | |
run: | | |
wget https://get.symfony.com/cli/installer -O - | bash | |
- name: Install dependencies | |
run: | | |
export PATH="$HOME/.symfony5/bin:$PATH" | |
COMPOSER_MEMORY_LIMIT=-1 COMPOSER_PROCESS_TIMEOUT=60 symfony composer update --prefer-dist --no-progress | |
symfony console bolt:info --ansi | |
npm set progress=false | |
npm ci | |
mkdir -p ./var/log/e2e-reports/report/features/ | |
touch ./var/log/e2e-reports/report/features/.gitkeep | |
# Install latest stable Chrome for e2e tests | |
sudo apt --fix-broken install | |
#sudo apt-get install libxss1 libappindicator1 libindicator7 | |
sudo apt-cache search libappindicator1 | |
sudo apt-get install libxss1 libindicator7 | |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
sudo apt install ./google-chrome*.deb | |
- name: Prepare environment | |
run: | | |
export PATH="$HOME/.symfony5/bin:$PATH" | |
# build assets | |
npm run build | |
sudo chmod -R 777 config/ public/files/ public/theme/ public/thumbs/ var/ | |
# prepare web server for e2e tests | |
symfony console doctrine:database:create | |
symfony console doctrine:schema:create | |
symfony console doctrine:fixtures:load --group=without-images -n | |
symfony server:start --no-tls --port=8088 -d | |
# test if web server works | |
sleep 3 | |
wget "http://127.0.0.1:8088/bolt/login" | |
- name: Cypress run | |
uses: cypress-io/github-action@v6 | |
with: | |
command: "npm run cypress:ci" | |
# Starts web server for E2E tests - replace with your own server invocation | |
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server | |
# start: npm start | |
wait-on: 'http://127.0.0.1:8088' # Waits for above | |
# Records to Cypress Cloud | |
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record | |
record: true | |
parallel: true | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: tests/cypress/screenshots |