From 3843c1515872c71a99ddb881b6944edfc1141769 Mon Sep 17 00:00:00 2001 From: Matthieu Rolland Date: Tue, 7 Feb 2023 14:50:34 +0100 Subject: [PATCH 1/2] Create licences.yml --- .github/workflows/licences.yml | 87 ++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/licences.yml diff --git a/.github/workflows/licences.yml b/.github/workflows/licences.yml new file mode 100644 index 0000000000000..98b5496b28ab3 --- /dev/null +++ b/.github/workflows/licences.yml @@ -0,0 +1,87 @@ +name: Integration tests +on: + push: + pull_request: + # Do not run when only tests are updated + paths-ignore: + - 'tests/UI/**' + +permissions: + contents: read # to clone the repos and get release assets (shivammathur/setup-php) +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + licences: + permissions: + contents: read # to clone the repos and get release assets (shivammathur/setup-php) + name: Licences check + runs-on: ubuntu-latest + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Setup MySQL + uses: mirromutth/mysql-action@v1.1 + with: + mysql version: '8.0' + mysql database: 'prestashop' + mysql root password: 'password' + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Setup NPM + run: npm install -g npm@7 + + - uses: actions/checkout@v3 + + - name: PrestaShop Configuration + run: | + cp .github/workflows/phpunit/parameters.yml app/config/parameters.yml + cp .github/workflows/phpunit/parameters.php app/config/parameters.php + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache Node Directory + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-node- + + - name: Cache Composer Directory + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Composer Install + run: composer install --ansi --prefer-dist --no-interaction --no-progress + + - name: Update phpunit version + if: ${{ startsWith(matrix.php, '8.') }} + run: composer update -w --ignore-platform-reqs --no-interaction phpunit/phpunit + + - name: Build theme assets + run: make front-classic + + - name: Change MySQL authentication method + run: mysql -h127.0.0.1 -uroot -ppassword -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; FLUSH PRIVILEGES;" + + - name: Run licences update + run: php bin/console prestashop:licenses:update + env: + SYMFONY_DEPRECATIONS_HELPER: disabled + + - name: Test git versionned files unchanged + if: ${{ !startsWith(matrix.php, '8.') }} # composer.lock changes when updating phpunit version + run: git diff --exit-code From 24a14681080ddd1d554f97fd2fd4e9b931424a2d Mon Sep 17 00:00:00 2001 From: "matthieu.rolland" Date: Tue, 7 Feb 2023 14:52:59 +0100 Subject: [PATCH 2/2] test --- classes/Product.php | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index ad79ce6bce9f2..d8333c7a957ac 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -1,28 +1,4 @@ - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - */ use PrestaShop\Decimal\DecimalNumber; use PrestaShop\PrestaShop\Adapter\ServiceLocator;