Stabilise UI tests and nightly #70
Workflow file for this run
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 workflow allows you to check potential changes to the structure of the database, | |
# and to apply the “Needs autoupgrade PR” label if this is the case | |
name: Create diff for 'Needs autoupgrade PR' label | |
on: pull_request | |
jobs: | |
install_prestashop_and_dump: | |
name: Install Prestashop and create database dump | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
branch: [ base, head ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: ${{ matrix.branch == 'head' && '0' || '1' }} | |
ref: ${{ matrix.branch == 'base' && github.event.pull_request.base.ref || github.event.pull_request.head.ref }} | |
repository: ${{ matrix.branch == 'base' && github.event.pull_request.base.repo.full_name || github.event.pull_request.head.repo.full_name }} | |
- name: Rebase head | |
if: ${{ matrix.branch == 'head' }} | |
run: | | |
git config --global user.email "prestashop@prestashop.com" | |
git config --global user.name "Bot" | |
git pull --rebase ${{ github.event.pull_request.base.repo.clone_url }} ${{ github.event.pull_request.base.ref }} | |
- name: Docker build | |
run: docker compose build prestashop-git | |
- name: Fetch dependencies | |
run: docker compose run --rm prestashop-git composer install --ansi --prefer-dist --no-interaction --no-progress | |
- name: Waiting for database | |
run: ./.docker/wait-for-it.sh --timeout=60 --strict localhost:3306 | |
- name: Create base database | |
run: docker compose run --rm mysql mysql -hmysql -uroot -pprestashop -e "CREATE DATABASE presta_${{ matrix.branch }};" | |
- name: Install shop | |
run: docker compose run --rm prestashop-git php install-dev/index_cli.php \ | |
--step=database --db_server=mysql:3306 --db_name=presta_${{ matrix.branch }} \ | |
--db_user=root --db_password=prestashop --prefix=ps_ --db_clear=1 \ | |
--domain=localhost:8001 --firstname="Marc" --lastname="Beier" \ | |
--password=Toto123! --email=demo@prestashop.com --language=fr --country=fr \ | |
--newsletter=0 --send_email=0 --ssl=0 | |
- name: Export dump | |
run: docker compose run --rm mysql sh -c "exec mysqldump -hmysql -uroot --no-data --compact -pprestashop presta_${{ matrix.branch }}" > dump_${{ matrix.branch }}.sql | |
- name: Upload dump | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dump_${{ matrix.branch }} | |
path: | | |
dump_${{ matrix.branch }}.sql | |
create_diff: | |
name: Create database dumps diff | |
needs: [ install_prestashop_and_dump ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Create diff | |
run: git diff ./dump_head/dump_head.sql ./dump_base/dump_base.sql > sql-diff.txt | true | |
- name: Save PR number | |
run: | | |
mkdir -p ./pr | |
echo ${{ github.event.number }} > ./pr_number | |
- name: Upload diff | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sql_diff | |
path: | | |
sql-diff.txt | |
pr_number |