Skip to content

Prevent Mysql Gone Away during unit test launch on docker container #571

Prevent Mysql Gone Away during unit test launch on docker container

Prevent Mysql Gone Away during unit test launch on docker container #571

Workflow file for this run

name: Unit test
on: [pull_request]
jobs:
# Run PHPUnit against the module and a PrestaShop release
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ['8.1.5']
steps:
- name: Checkout
uses: actions/[email protected]
# Add vendor folder in cache to make next builds faster
- name: Cache vendor folder
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
# Add composer local folder in cache to make next builds faster
- name: Cache composer folder
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-composer-cache
- run: composer update
# Get Docker images 202ecommerce/prestashop
- name: Get PrestaShop 202 Image (Tag ${{ matrix.presta-versions }})
run: docker run -tid --rm -v $PWD:/var/www/html/modules/shoppingfeed --name temp-unittest-ps 202ecommerce/prestashop:${{ matrix.presta-versions }}
# Clear previous instance of the module in the PrestaShop volume
- name: Install module and play unit test
run: docker exec -t temp-unittest-ps sh /var/www/html/modules/shoppingfeed/202/docker/run_for_unittest.sh